Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I can't access remote Jupyter Notebook server?

I have started a Jupyter Notebook server on my centos6.5 server.And jupyter is running like

[I 17:40:59.649 NotebookApp] Serving notebooks from local directory: /root [I 17:40:59.649 NotebookApp] 0 active kernels  [I 17:40:59.649 NotebookApp] The Jupyter Notebook is running at:https://[all ip addresses on your system]:8045/ [I 17:40:59.649 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 

When I want to access Jupyter remotely in the same local area network, say open http://192.168.1.111:8045/, I can't open a Jupyter page at all. By the way, I can access remote centos server successfully.

What's the possible reason?

like image 477
Peng He Avatar asked Mar 17 '17 02:03

Peng He


People also ask

How do I access the Jupyter Lab server?

Connecting and running Jupyterlab from a laptop is straightforward. You simply type jupyter lab into your terminal and Jupyterlab will open in your browser, with the Notebook server running in your terminal.

Why can't I access my Jupyter server remotely?

From your command line, we can see your jupyter server is running normally.The reason you can't access your remote jupyter server is that your remote centos6.5 server's firewall rules block the incoming request from your local browser,i.e. block your tcp:8045 port. then try to access your jupyter again.

How do I run a Jupyter Notebook remotely?

Steps to Run Jupyter Notebook Remotely 1 Login to Remote Server. Just a normal SSH login. ... 2 Run Notebook with Specified Port Number. It will start the Jupyter Notebook on the specified port number. ... 3 Map Local Port to Remote Port. ... 4 Open Local Browser with Port Number. ... 5 Login Notebook with Token. ...

What port does Jupyter use to open a notebook?

In case one uses different ports, 8888:127.0.0.1:8888, the first 8888 is the port on the local machine, the later one is the port on the remote machine. this worked well, instead of login to the server and then trying to open a jupyter notebook.

How to SSH into Jupyter notebook from another server?

Just a normal SSH login. Replace with your username and server address. 2. Run Notebook with Specified Port Number. Once logged in to the remote server, cd to the desired directory, and run the following command: jupyter notebook --no-browser --port=8086. It will start the Jupyter Notebook on the specified port number.


2 Answers

Have you configured the jupyter_notebook_config.py file to allow external connections?

By default, Jupyter Notebook only accepts connections from localhost (eg, from the same computer that its running on). By modifying the NotebookApp.allow_origin option from the default ' ' to '*', you allow Jupyter to be accessed externally.

c.NotebookApp.allow_origin = '*' #allow all origins

You'll also need to change the IPs that the notebook will listen on:

c.NotebookApp.ip = '0.0.0.0' # listen on all IPs


Also see the details in a subsequent answer in this thread.

Documentation on the Jupyter Notebook config file.

like image 184
James023 Avatar answered Oct 23 '22 16:10

James023


I managed to get the access my local server by ip using the command shown below:

jupyter notebook --ip xx.xx.xx.xx --port 8888 

replace the xx.xx.xx.xx by your local ip of the jupyter server.

like image 31
Teo Kok Keong Avatar answered Oct 23 '22 15:10

Teo Kok Keong