Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hurutoriya/b2a48fa70b048117e35e to your computer and use it in GitHub Desktop.
Save hurutoriya/b2a48fa70b048117e35e to your computer and use it in GitHub Desktop.
How to public jupuyernotebook on remote server?

Access to remote server. and we user PYENV for set up python environment.

$ ssh your_remote_server
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ vim .zshrc
export PYENV_ROOT=$HOME/.pyenv
export PATH=$PYENV_ROOT/bin:$PATH
eval "$(pyenv init -)"

Read shell setting.

$ source .zshrc

Install Python and Jupyter.

$ pyenv install 3.5.1
$ pyenv global 3.5.1
$ easy_install pip
$ pip install jupyter
$ jupyter notebook --generate-config
$ ipython ## set password you jupyternotebook server
In [1]: from notebook.auth import passwd
In [2]: passwd()
# generated hash. copy hash value for password setting to you remote server.
$ netstat -an |grep ESTABLISHED # search ip-address on your remote server
$ vim .jupyter/jupyter_notebook_config.py

.jupyter/jupyter_notebook_config.py

#------------------------------------------------------------------------------
# NotebookApp configuration
#------------------------------------------------------------------------------

# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:yourcopiedhasuvalue'
c.NotebookApp.open_browser = False
# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999
$ jupyter notebook
$ open http://your.ipaddress-on-remoteserver:portnumber

https://gyazo.com/b322064043cc8c74a84548eb269925d0

https://gyazo.com/46dd76366795268a018da2c5f3c82fbf

$ pip install jupyterhub
$ jupyterhub --generate-config # not make dotfiles directory. make the current directory.
$ vim jupyterhub_config.py # not dotfiles directory.
$ jupyterhub  --port 9999 # set port number

https://gyazo.com/00b61b7179f3f4043e03a30a1b70a4af

Admin View

https://gyazo.com/7e107956009d744f0973f4baf6e057e7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment