DEV Community

Akilesh
Akilesh

Posted on • Updated on

Running Jupyter in Docker

" This article is published using Lamento🍋

🐬Docker is like an isolated operating system where you can build and run all your development needs in a docker environment and we are going to install and run jupyter notebook from docker. Jupyter starts up a local Python server to serve these apps to your web browser.


1 (Get Image) 🖼️:

Get the Docker image of jupyter notebook from here

They have a list of different docker images for various needs

  • jupyter/base-notebook
  • jupyter/minimal-notebook
  • jupyter/r-notebook
  • jupyter/scipy-notebook
  • jupyter/tensorflow-notebook
  • jupyter/datascience-notebook
  • jupyter/pyspark-notebook
  • jupyter/all-spark-notebook Image Relationships

If you are just here to test things out you can try minimal-notebook it has the basic jupyter notebook features in small image size.
You can try jupyter/all-spark-notebook which has access to all the features but in cost to its larger image size. It depends upon your need but the steps are going to be the same for all.

For this post, I am using jupyter/scipy-notebook
First, we will pull the docker jupyter image to your local machine.

docker pull jupyter/scipy-notebook:latest
Enter fullscreen mode Exit fullscreen mode

2 (Run Container) 🏃:

Next, we will run the image in a docker container.

docker run -it --name scipy-notebook -p 8080:8888 jupyter/scipy-notebook:latest
Enter fullscreen mode Exit fullscreen mode

This will start a container that contains our jupyter scipy notebook image or whatever image you used.

Image description


3 (Navigate) 🧭:

navigate to your browser localhost port 8080 http://localhost:8080/ to access jupyter notebook in a browser.


4 (Bonus) ✨:

If you see any password or token required page in jupyter follow the step below else you can close this tab and play with jupyter notebook in docker.

Image description

Open your current running docker container which contains the image of the jupyter notebook and type:

jupyter notebook list
Enter fullscreen mode Exit fullscreen mode

Image description
which will list out the current running notebook servers copy the token listen in the CLI and paste it in the jupyter token required page else scroll below and you can set a password with your token.

Finally 🥂 :

Image description

Top comments (0)