Install a jupyter hub with a terminal access to Linux Ubuntu 20.04 with docker



  • open a terminal
  • docker ps -a
  • docker pull jupyterhub/jupyterhub
  • docker run -it -p 8000:8000 –name jhubcontainer [jupyterhub/juoyterhub or the ID here] bash
  • apt update
  • apt-get update
  • apt-get install -y git
  • apt-get install npm nodejs python3 python3-pip git nano
  • python3 -m pip install jupyterhub notebook jupyterlab
  • npm install -g configurable-http-proxy
  • apt-get update
  • apt-get install zsh -y
  • chsh -s /usr/bin/zsh
  • echo $SHELL
  • sh -c “$(curl -fsSL”
  • cd /home
  • git clone
  • pip install jupyterhub-nativeauthenticator
# Copy image file to the server
scp [file Address] [user]@[host address]:/home/express/

#load the image
docker load < busybox.tar.gz
# execute the container
docker exec -it <mycontainer> bash
# save the container to an image
docker commit [container] [name] 
# remove an image from docker
docker rmi [image]


For this tutorial you need Docker installed in Windows .

Install Docker From a standard Ubuntu Repository

sudo apt install
# Start docker and enable it to start after the system reboot:
sudo systemctl enable --now docker
# Optionally give any user administrative privileges to docker:
sudo usermod -aG docker SOMEUSERNAME
# You will need to log out and log in to apply the changes.

#open a Windows cmd and type


#run a jupyterhub container

docker run -it -p 8000:8000 --name jhubcontainer jupyterhub/jupyterhub bash

# update the repositories

apt update 

# install python3 and related packages

apt-get install npm nodejs python3 python3-pip git nano

# install jupyterhub and jupyterlab

python3 -m pip install jupyterhub notebook jupyterlab

# install nodejs packages

npm install -g configurable-http-proxy

# install native authenticator package

cd /home
git clone
cd nativeauthenticator
pip3 install -e .

#modify jupyterconfig

mkdir /etc/jupyterhub 
cd /etc/jupyterhub   
jupyterhub --generate-config -f jupyterhub_co

#edit the jupyterhun config file

import pwd, subprocess

c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'

c.Authenticator.admin_users = {'admin'}

def pre_spawn_hook(spawner):

    username =



    except KeyError:

        subprocess.check_call(['useradd', '-ms', '/bin/bash', username])

c.Spawner.pre_spawn_hook = pre_spawn_hook

c.Spawner.default_url = '/lab'
docker commit -m "all installed" jupyterhub_container jupyterhub_plus
docker exec -it jupyterhub_container zsh
docker build -t jup:1 .

# run jupyterhub

jupyterhub -f /etc/jupyterhub/

# configure admin and users


Sign up your admin as “admin” and password.

Login as admin and go the authorize window:


#get the local ip from the computer by typing this in a new cmd:


# for new users

Go to the server local ip address and jupyterhub port


New users that sign up will be displayed to be authorized.
not related but beautiful:
source venv/bin/activate
Also to create it:
virtualenv venv