Multi-user server for Jupyter notebooks
Clone or download
minrk Merge pull request #2296 from pelson/logo_in_page_template
Add a logo block, and update the docs regarding base.html.
Latest commit c633d87 Nov 15, 2018
Permalink
Failed to load latest commit information.
.circleci add build context to alpine dir Apr 26, 2018
.github Update issue templates Jun 12, 2018
ci remove `--rm` from docker-db.sh May 21, 2018
dockerfiles updated CMD and jupyterhub version is put into argument Dec 4, 2017
docs Merge pull request #2296 from pelson/logo_in_page_template Nov 15, 2018
examples Update README.md Oct 12, 2018
hooks add .dev suffix to development x.y image tags Aug 20, 2018
jupyterhub Clear the auth cache when testing the same url twice with different r… Nov 12, 2018
onbuild fix onbuild build arg Apr 26, 2018
scripts move singleuser script into the package May 31, 2016
share/jupyterhub Add a logo block, and update the docs regarding base.html. Nov 9, 2018
singleuser publish singleuser x.y.z.dev from master Aug 20, 2018
testing Merge branch 'master' into master Sep 28, 2018
tools Remove zip from sdist build per PEP 527 Sep 1, 2016
.coveragerc unpin coverage Oct 19, 2018
.dockerignore add singleuser build dir from dockerspawner Aug 18, 2017
.flake8 flesh out oauth provider Sep 10, 2018
.gitignore unpin coverage Oct 19, 2018
.travis.yml ssl tests can use configproxy Oct 12, 2018
CHECKLIST-Release.md Make the release checklist a GFM checklist Nov 11, 2016
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Jun 12, 2018
CONTRIBUTING.md Reformat index.rst to get linkable sections Sep 26, 2018
COPYING.md cleanup pass Aug 20, 2014
Dockerfile Bumped Miniconda to 4.5.11 Oct 24, 2018
MANIFEST.in include package-lock in sdists May 7, 2018
PULL_REQUEST_TEMPLATE.md Create PULL_REQUEST_TEMPLATE.md Jun 12, 2018
README.md add link to community guide reference Sep 12, 2018
bower-lite bower-lite, too Feb 28, 2018
dev-requirements.txt unpin coverage Oct 19, 2018
package.json add `npm run fmt` for autoformatting js Sep 24, 2018
pytest.ini disable pytest minversion check Nov 8, 2018
readthedocs.yml omit pdf builds on rtd due to bug in sphinx Sep 24, 2018
requirements.txt Merge branch 'master' into end-to-end-ssl Oct 2, 2018
setup.py register simplespawner in setup.py Nov 5, 2018
setupegg.py make it a proper package Aug 21, 2014

README.md

Technical Overview | Installation | Configuration | Docker | Contributing | License | Help and Resources

JupyterHub

PyPI Documentation Status Documentation Status Build Status Circle CI codecov.io Google Group

With JupyterHub you can create a multi-user Hub which spawns, manages, and proxies multiple instances of the single-user Jupyter notebook server.

Project Jupyter created JupyterHub to support many users. The Hub can offer notebook servers to a class of students, a corporate data science workgroup, a scientific research project, or a high performance computing group.

Technical overview

Three main actors make up JupyterHub:

  • multi-user Hub (tornado process)
  • configurable http proxy (node-http-proxy)
  • multiple single-user Jupyter notebook servers (Python/Jupyter/tornado)

Basic principles for operation are:

  • Hub launches a proxy.
  • Proxy forwards all requests to Hub by default.
  • Hub handles login, and spawns single-user servers on demand.
  • Hub configures proxy to forward url prefixes to the single-user notebook servers.

JupyterHub also provides a REST API for administration of the Hub and its users.

Installation

Check prerequisites

  • A Linux/Unix based system

  • Python 3.5 or greater

  • nodejs/npm

    • If you are using conda, the nodejs and npm dependencies will be installed for you by conda.

    • If you are using pip, install a recent version of nodejs/npm. For example, install it on Linux (Debian/Ubuntu) using:

      sudo apt-get install npm nodejs-legacy
      

      The nodejs-legacy package installs the node executable and is currently required for npm to work on Debian/Ubuntu.

  • TLS certificate and key for HTTPS communication

  • Domain name

Install packages

Using conda

To install JupyterHub along with its dependencies including nodejs/npm:

conda install -c conda-forge jupyterhub

If you plan to run notebook servers locally, install the Jupyter notebook or JupyterLab:

conda install notebook
conda install jupyterlab

Using pip

JupyterHub can be installed with pip, and the proxy with npm:

npm install -g configurable-http-proxy
python3 -m pip install jupyterhub    

If you plan to run notebook servers locally, you will need to install the Jupyter notebook package:

python3 -m pip install --upgrade notebook

Run the Hub server

To start the Hub server, run the command:

jupyterhub

Visit https://localhost:8000 in your browser, and sign in with your unix PAM credentials.

Note: To allow multiple users to sign into the server, you will need to run the jupyterhub command as a privileged user, such as root. The wiki describes how to run the server as a less privileged user, which requires more configuration of the system.

Configuration

The Getting Started section of the documentation explains the common steps in setting up JupyterHub.

The JupyterHub tutorial provides an in-depth video and sample configurations of JupyterHub.

Create a configuration file

To generate a default config file with settings and descriptions:

jupyterhub --generate-config

Start the Hub

To start the Hub on a specific url and port 10.0.1.2:443 with https:

jupyterhub --ip 10.0.1.2 --port 443 --ssl-key my_ssl.key --ssl-cert my_ssl.cert

Authenticators

Authenticator Description
PAMAuthenticator Default, built-in authenticator
OAuthenticator OAuth + JupyterHub Authenticator = OAuthenticator
ldapauthenticator Simple LDAP Authenticator Plugin for JupyterHub
kdcAuthenticator Kerberos Authenticator Plugin for JupyterHub

Spawners

Spawner Description
LocalProcessSpawner Default, built-in spawner starts single-user servers as local processes
dockerspawner Spawn single-user servers in Docker containers
kubespawner Kubernetes spawner for JupyterHub
sudospawner Spawn single-user servers without being root
systemdspawner Spawn single-user notebook servers using systemd
batchspawner Designed for clusters using batch scheduling software
wrapspawner WrapSpawner and ProfilesSpawner enabling runtime configuration of spawners

Docker

A starter docker image for JupyterHub gives a baseline deployment of JupyterHub using Docker.

Important: This jupyterhub/jupyterhub image contains only the Hub itself, with no configuration. In general, one needs to make a derivative image, with at least a jupyterhub_config.py setting up an Authenticator and/or a Spawner. To run the single-user servers, which may be on the same system as the Hub or not, Jupyter Notebook version 4 or greater must be installed.

The JupyterHub docker image can be started with the following command:

docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub

This command will create a container named jupyterhub that you can stop and resume with docker stop/start.

The Hub service will be listening on all interfaces at port 8000, which makes this a good choice for testing JupyterHub on your desktop or laptop.

If you want to run docker on a computer that has a public IP then you should (as in MUST) secure it with ssl by adding ssl options to your docker configuration or by using a ssl enabled proxy.

Mounting volumes will allow you to store data outside the docker image (host system) so it will be persistent, even when you start a new image.

The command docker exec -it jupyterhub bash will spawn a root shell in your docker container. You can use the root shell to create system users in the container. These accounts will be used for authentication in JupyterHub's default configuration.

Contributing

If you would like to contribute to the project, please read our contributor documentation and the CONTRIBUTING.md. The CONTRIBUTING.md file explains how to set up a development installation, how to run the test suite, and how to contribute to documentation.

A note about platform support

JupyterHub is supported on Linux/Unix based systems.

JupyterHub officially does not support Windows. You may be able to use JupyterHub on Windows if you use a Spawner and Authenticator that work on Windows, but the JupyterHub defaults will not. Bugs reported on Windows will not be accepted, and the test suite will not run on Windows. Small patches that fix minor Windows compatibility issues (such as basic installation) may be accepted, however. For Windows-based systems, we would recommend running JupyterHub in a docker container or Linux VM.

Additional Reference: Tornado's documentation on Windows platform support

License

We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.

All code is licensed under the terms of the revised BSD license.

Help and resources

We encourage you to ask questions on the Jupyter mailing list. To participate in development discussions or get help, talk with us on our JupyterHub Gitter channel.

JupyterHub follows the Jupyter Community Guides.


Technical Overview | Installation | Configuration | Docker | Contributing | License | Help and Resources