Access Jupyter notebook running on Docker container

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.


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.


The docker run command is mandatory to open a port for the container to allow the connection from a host browser, assigning the port to the docker container with -p, select your jupyter image from your docker images.

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

Inside the container launch the notebook assigning the port you opened:

jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --allow-root

Access the notebook through your desktops browser on http://localhost:8888 The notebook will prompt you for a token which was generated when you create the notebook.


To get the link to your Jupyter notebook server:

After your docker run command, a hyperlink should be automatically generated. It looks something like this: http://localhost:8888/?token=f3a8354eb82c92f5a12399fe1835bf8f31275f917928c8d2 :: /home/jovyan/work

If you want to get the link again later down the line, you can type docker exec -it <docker_container_name> jupyter notebook list.