When you launch Jupyter Notebook, it runs a small web server on the local system.
You can allow access to a notebook directory so that others can view, use, and create notebooks on a single server instance. Jupyter Notebook can be configured for password login, notebook directory, and ports.
Configure Jupyter notebook to set the directory:
1. Installing Anaconda installs jupyter notebook.
2. Generate the default jupyter_notebook_config.py file:
jupyter notebook --generate-config
This will put the file in the following directory:
3. You can now edit this config file to make changes.To set the directory from where Jupyter starts and serves notebooks from, find the following line and uncomment it. Add the full path of the directory you want to serve from:
## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = u'/< Path-to-Notebook_dir> '
4. To set Jupyter Notebook Server to listen to all incoming connections to access the notebook directory, find the following line and uncomment it. You can set the ip to
0.0.0.0 to listen to all connections:
## The IP address the notebook server will listen on.
c.NotebookApp.ip = '0.0.0.0'
5. Now you can access the notebook directory from another system by entering the IP address of the system running the notebook server, along with the default port 8888. This will allow anyone to connect without any authentication. EXAMPLE: http://ip-address:8888.
Configure Jupyter notebook to require a shared password for access.
1. Generate a password to copy into the Jupyter config file.
Open a Python console:
And run the following to generate the hash:
from notebook.auth import passwd
2. Copy the entire string that is printed to the console by the above commands and then find the following line, uncomment it and add the hash:
##The string should be of the form type:salt:hashed-password.
c.NotebookApp.password = u'hash_from_above_step'
3. To change the port, the Notebook Server will listen, find the following line, uncomment it and add the port number, default is 8888:
## The port the notebook server will listen on.
c.NotebookApp.port = 8888
4. You should now be able to access Jupyter by entering the host system's IP address followed by the port number,
http://ip_address:port. It should take you to a login page where you can use the password you typed in to create the hash.
General trouble shooting:
You can delete the config file and generate a new default config file any time,
If settings do not appear or the Jupyter is not accessible in the browser make sure you uncommented all of the config line by removing the preceding
# and the values are enclosed in