Two Steps to access Windows Jupyter Notebook Remotely

Two step to access windows jupyter notebook remotely :-Jupyter Notebook is a very popular and powerful tool for testing and developing Data science and machine learning projects. Jupyter Notebook has good feature to run code on web browser, but has limitation to expose to public. When you have high end windows server where you install the Python and Jupyter Notebook is always difficult task to login server via RDP and launch Jupyter notebook, and again windows server allow only 2 concurrent user by default, so only two users at a time can work on notebook and if you want to share your netbook to team you need to save and share. To install Jupyter notebook on windows follow below official document Jupyter Notebook.

conda install -c conda-forge jupyterlab
OR
pip install jupyterlab

Two Steps to access Windows Jupyter Notebook Remotely, windows server as Jupyter notebook server or access Jupyter notebook from public having below advantages: –

  1. Public notebook has advantage to work on live code between the team member and see the result. (like Google doc).
  2. Jupyter Notebook can accusable to multiple users at same time.
  3. Your can share notebook to other members.
  4. Instead of localhost 127.0.0.1 you can define your custom IP and port which is accessible publicly.
  5. Your can protect your notebook folder with password and SSL encryption to protect and control user access.
  6. You can use iframe or other html code to embedding notebook to website.
  7. Batter windows server resource management.

Connect to jupyter notebook remotely

To connect jupyter notebook remotely form public you need to setup a Jupyter notebook server once your Jupyter notebook installed go to anaconda command prompt type below command.

You can run below command to run Jupyter server and then switch to other remote web browser and access by kust typing http://ip-address:port.

$ jupyter notebook –no-browser –ip=”your server IP Address” –port=8888

 I recommend you to make password first than other thing.

PS C:\Users\onclick360> jupyter notebook password
Enter password:
Verify password:
[NotebookPasswordApp] Wrote hashed password to C:\Users\onclick360\.jupyter\jupyter_notebook_config.json

Next open your jupyter notebook jupyter_notebook_config.json file in text editor and add below line if not exist and replace your password sha1:xxxxx with original password.

{
"NotebookApp": {
"password": "sha1:xxxxxxxxxxxxxxxxxxxxx",
"open_browser": false,
"port": 8888,
"ip": "*",
"notebook_dir": "C:\onclick360\ML\jupyter_notebooks"
}
}

Next run below command to create notebook configuration file to make notebook public.

$ jupyter notebook --generate-config

Once file generated go to below path and open in text editor and modify below commented lines.

Windows: C:\Users\USERNAME\.jupyter\jupyter_notebook_config.py

c.NotebookApp.allow_origin = '*'
c.NotebookApp.allow_remote_access = True
# listen for all IPs
c.NotebookApp.ip = '0.0.0.0'
you need to add hashed password from jupyter Json file C:\Users\onclick360\.jupyter\jupyter_notebook_config.json 
c.NotebookApp.password = 'sha1:abc84dbd2d91:9xxxxxxxxxxxcff7966775857b'

After modifying all lines save the jupyter_notebook_config.py file and run the jupyter notebook.

You can then start the notebook using the   jupyter notebook  command.

How to access jupyter notebook remotely

Once Jupyter notebook running switch to any remote public system web browser and run http://ip:8888 you will able to see password prompt of your Jupyter Notebook. 

Once you type password your jupyter notebook default folder will open and from there you can start either new or existing jupyter notebook once your notebook kernel ready.

jupyter notebook public

In this article we cover basic way to make your windows Jupyter Notebook accessible remotely, but you need to do some advance level of configuration for security (SSL,TSL certificate) to secure your notebook in public environment,Please follow document of advance setting  .

You May Also Like