snippets > simple-docker-one-liner-jupyter-notebook-python

November 13, 2020

Simple Docker one-liner to run Jupyter Notebook with Python

The following command will start a Jupyter instance mounting the current folder.

docker run --rm -v ${PWD}:/home/jovyan/work -p 8888:8888 --user root -e GRANT_SUDO=yes -e NB_UID=$(id -u) -e NB_GID=$(id -u) -e NOTEBOOK_ARGS="--IdentityProvider.token=''" jupyter/scipy-notebook:latest

Explanation about the chosen environment variables:

CHOWN_HOME=yes          # ensure the home directory is writable for Jupyter
GRANT_SUDO=yes          # grant passwordless sudo to the notebook user

Further reading

List of all environment variables available using Docker

Official documentation about Jupyter Docker stacks