Installation#

  1. Install Python≥3.6 and pip:

    $ sudo apt update
    $ sudo apt install python3
    $ python3 -V
    Python 3.10.6
    $ sudo apt install python3-pip
    
  2. Create service user jupyter:

    $ sudo useradd -s /bin/bash -rmd /srv/jupyter jupyter
    
  3. Switch to the service user jupyter:

    $ sudo -u jupyter -i
    
  4. Install Pipenv:

    $  python3 -m pip install --user pipenv
    

    This installs Pipenv in USER_BASE.

  5. Determine USER_BASE and enter it in PATH:

    $  python3 -m site --user-base
    /srv/jupyter/.local
    

    Then the bin directory must be appended and added to PATH in ~/.profile, so:

    export PATH=/srv/jupyter/.local/bin:$PATH
    

    Finally, the changed profile is read in with:

    $  source ~/.profile
    
  6. Create a virtual environment and install JupyterHub:

    $ mkdir jupyterhub_env
    $ cd jupyterhub_env
    $ pipenv install jupyterhub
    
  7. Install nodejs and npm:

    $ sudo apt install nodejs npm
    $ node -v
    v12.22.9
    $ npm -v
    8.5.1
    
  8. Install the HTTP proxy:

    $ sudo npm install -g configurable-http-proxy
    
  9. If JupyterLab and Notebook are to run in the same environment, they must also be installed here:

    $  pipenv install jupyterlab notebook
    
  10. Testing the installation:

    $  pipenv run jupyterhub -h
    $  configurable-http-proxy -h
    
  11. Starting the JupyterHub:

    $  pipenv run jupyterhub
    ...
    [I 2019-07-31 22:47:26.617 JupyterHub app:1912] JupyterHub is now running at http://:8000
    

    You can end the process again with ctrl-c.