Installing and Configuring Jupyterhub

Jupyterhub Installation

In what follows, we list the steps to install Jupyterhub on a remote ubuntu server.

Installing Python3 (dependency of Jupyterhub is on Python3)
$ sudo apt-get -y install python3-pip

Installing nodejs/npm
$ sudo apt-get -y install npm nodejs

Installing proxy with npm
$ sudo npm install -g configurable-http-proxy

Installing Jupyterhub
$ sudo pip3 install jupyterhub

Installing Jupyter notebook (/upgrade)
$ sudo pip3 install --upgrade notebook

Running the above commands in the sequence as provided should install Jupyterhub properly.

Test the installation:
$ sudo jupyterhub --no-ssl
This should create an instance of the jupyter notebook on http://(your-ip-address):8000 (without parenthesis).

Jupyterhub Configuration

Running the following command will generate a default config file for Jupyterhub
$ jupyterhub --generate-config
It is recommended to store the generated jupyterhub_config.py in the standard UNIX filesystem local i.e. /etc/jupyterhub.

(Optional) Create the Jupyterhub configuration directory:
If you do not have the directory already created, follow the steps to create the directory. Feel free to skip this step if you already do.
$ sudo mkdir /etc/jupyterhub/

The jupyterhub_config.py file contains comments for numerous configuration variables. We list the most important configurations below, which are useful for the nbgrader setup.
Note: The below configuration is for setting up Jupyterhub on mathpost.asu.edu on port 9000. Please change the configurations according to your requirements.
c.JupyterHub.ip = 'mathpost.asu.edu'
c.JupyterHub.port = 9000

Furthermore, configure the path for SSL key and certificate using c.JupyterHub.ssl_key and c.JupyterHub.ssl_cert respectively.

To start JupyterHub using the updated configurations, run the following command:
$ sudo jupyterhub -f /etc/jupyterhub/jupyterhub_config.py

Sidebar