Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access Jupyter notebook running on Docker container

I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook

But from my host, what is the IP address I have to use to work with Jupyter in host's browser ?

With the command ifconfig, I find eth0, docker, wlan0, lo ...

Thanks !

like image 347
J.Guillaumin Avatar asked Aug 08 '16 13:08

J.Guillaumin


People also ask

Can I access a Jupyter Notebook remotely?

you can run jupyter notebook --no-browser --ip="<remote server ip>" on your remote machine terminal. And access notebooks using http://:8888/?token=<> from your browser on local machine.


2 Answers

You need to run your notebook on 0.0.0.0: jupyter notebook -i 0.0.0.0. Running on localhost make it available only from inside the container.

like image 200
Mateusz Moneta Avatar answered Oct 09 '22 14:10

Mateusz Moneta


Host machine: docker run -it -p 8888:8888 image:version

Inside the Container : jupyter notebook --ip 0.0.0.0 --no-browser --allow-root

Host machine access this url : localhost:8888/tree‌​

When you are logging in for the first time there will be a link displayed on the terminal to log on with a token.

like image 44
Lahiru Karunaratne Avatar answered Oct 09 '22 13:10

Lahiru Karunaratne