Linux server Jupyter-Notebook remote connection settings
The focus is on the simple tutorial of connecting to a remote server and configuring the Anaconda environment from Jupyter notebook
1. First, install Jupyter notebook on the Linux server.
Install Jupyter notebook:
pip install Jupyter
2. Generate Jupyter notebook configuration file
jupyter notebook --generate-config
3. Configure the Jupyter notebook password
jupyter notebook password
Enter password: ****(custom)
Verify password: ****
The new version of Jupyter notebook only needs to enter the password for confirmation, and then it will automatically input the hash code containing the password into the jupyter_notebook_config.json file for you.
4. Configure the jupyter_notebook_config.py file
Enter the vim editor to edit jupyter_notebook_config.py.
vim ~/.jupyter/jupyter_notebook_config.py
Uncomment the following configuration and modify the content as follows:
c.NotebookApp.allow_remote_access = True
c.NotebookApp.open_browser = False
c.NotebookApp.ip = '*'
c.NotebookApp.allow_root = True
c.NotebookApp.port = 8888 # Actually, I don't know if this is useful, because I later Started on the specified port
Notice! ! !
When uncommenting, modify the code must be in the top space on the left, otherwise an error will be reported! ! !
5. Enter the command in the Linux console to start the service
jupyter notebook --no-browser --port=80 --ip=0.0.0.0
Among them,
–no-browser : Indicates that the Linux server does not automatically pop up the browser.
–port=80 --ip=0.0.0.0 : 80 means that the jupyter service will start on port 80, and 0.0.0.0 means that any host is allowed to access.
6. Use jupyter of Linux server locally
Type in the local browser
http://(server ip address):80(port number)
Enter the password to log in and use it remotely.