JupyterHub 6.2 on Ubuntu 26.04 LTS on Azure User Guide
Overview
JupyterHub is the multi-user server for Jupyter notebooks: it signs people in, starts a notebook server for each of them and proxies their browser to it, so a team or a class works in JupyterLab from one machine without installing anything locally. The cloudimg image installs JupyterHub 6.2.0 with JupyterLab 4.6.6 and Notebook 7.6.5 in a Python 3.14 virtual environment at /opt/jupyterhub, on a hardened Ubuntu 26.04 LTS base patched at build time, with nginx serving the hub on port 80.
Each hub user is a Linux account on the VM, and each user's notebook server and kernels run as that Linux user, in that user's home directory, never as root, so one user's files and processes are separate from another's. Users sign in with a hub password kept in the hub's own password file, never in the Linux accounts, so a hub password cannot be used for SSH or sudo. The image ships with no usable password: a one shot first boot service sets a unique hub password for the jupyter user on every VM and records it in a root only file. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours.
What is included:
- JupyterHub 6.2.0, JupyterLab 4.6.6 and Notebook 7.6.5 (BSD-3-Clause) in
/opt/jupyterhubon Python 3.14, with configurable-http-proxy 5.4.0 on Node.js 22.23 LTS (from nodejs.org) - nginx on port
80, proxying to the hub on loopback with the websocket upgrade that notebook kernels need - Sign-in with hub passwords for Linux accounts (
CloudimgPasswordAuthenticator, set withsudo jupyterhub-passwd <user>); only the users you allow may sign in - One notebook server per user, run as that Linux user (
LocalProcessSpawner), listening on loopback only, signed in to the hub over OAuth with PKCE required - The
jupyteruser as the hub administrator, with a unique hub password made on each VM's first boot jupyterhub-firstboot.service,jupyterhub.serviceandnginx.serviceas enabled systemd units; the hub and nginx start only after first boot has set the password- cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Prerequisites
An active Azure subscription, an SSH key pair, and a VNet plus subnet in the target region. Standard_B2ms (2 vCPU / 8 GiB RAM) is a sensible starting point for a few users; size up for more users or heavier notebooks, since every user's kernels run on this VM. NSG inbound: allow 22/tcp from your management network and 80/tcp for the hub. Restrict 80/tcp to trusted networks and place TLS in front of it for production, since notebooks can run code on the VM.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for JupyterHub 6.2 on Ubuntu 26.04 LTS by cloudimg, and select Create. On Basics pick your subscription, resource group, region and size; under Administrator account choose SSH public key and paste your key; under Inbound port rules allow SSH (22) and HTTP (80). Review the defaults, then Review + create then Create.
Step 2 - Deploy from the Azure CLI
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn cloudimg1647283583153:jupyterhub-ubuntu-26-04:default:latest
az vm create \
--resource-group <your-rg> \
--name jupyterhub \
--image cloudimg1647283583153:jupyterhub-ubuntu-26-04:default:latest \
--size Standard_B2ms \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku Standard
Then open the web port:
az vm open-port --resource-group <your-rg> --name jupyterhub --port 80 --priority 900
Step 3 - Confirm the services are running
SSH in as the admin user you chose at deploy (azureuser in the CLI example above) and confirm the first boot service, the hub and nginx are active. nginx listens on port 80; the hub's proxy (127.0.0.1:8000), the proxy's API (127.0.0.1:8001) and the hub's API (127.0.0.1:8081) listen on loopback only.
systemctl is-active jupyterhub nginx jupyterhub-firstboot
/opt/jupyterhub/bin/jupyterhub --version
sudo ss -tlnp | grep -E ':(80|8000|8001|8081) ' | awk '{print $4, $6}'

Step 4 - Retrieve your per-VM password
The image ships with no usable password. On the first boot of every VM, jupyterhub-firstboot.service sets a unique hub password for the jupyter user and records it, with the hub's address, in a root only credentials file. Read it with sudo:
sudo cat /root/jupyterhub-credentials.txt
The file holds JUPYTERHUB_URL (the VM's public address when Azure reports one at first boot; otherwise use your VM's public IP from the portal), JUPYTERHUB_USER (jupyter) and JUPYTERHUB_PASSWORD. The password signs in to the hub only: the jupyter Linux account itself has no password. Change it at any time with sudo jupyterhub-passwd jupyter, which asks for the new password twice and takes effect at the next sign-in.
sudo stat -c '%a %U:%G %n' /root/jupyterhub-credentials.txt

Step 5 - Sign in to the hub
Browse to http://<your-vm-public-ip>/. The hub shows its sign-in page; sign in as jupyter with the password from the credentials file. Any other name, a user that is not allowed, or a wrong password is refused.

The hub starts your own notebook server and opens JupyterLab on its launcher, in the jupyter user's home directory.

Step 6 - Run a notebook
Choose Python 3 (ipykernel) under Notebook, type some Python in the first cell and press Shift+Enter. The kernel runs as your own Linux user, which you can see from inside the notebook:
import getpass, sys, jupyterlab
print("Hello from JupyterHub on Azure")
print("kernel user:", getpass.getuser())
print("Python", sys.version.split()[0], "| JupyterLab", jupyterlab.__version__)

Notebooks are saved in the user's home directory (/home/jupyter for the jupyter user), which only that user can read.
Step 7 - Check that each user's server runs as that user
From your SSH session, confirm the hub's sign-in and spawner settings, that it starts each user's server as that user's Linux account, and that the user's home is private to them. The process list shows each signed-in user's jupyterhub-singleuser server, plus an ipykernel_launcher line per running kernel, every one owned by that user and none by root:
grep -E '^c\.(JupyterHub\.(authenticator|spawner)_class|Authenticator\.(allowed|admin)_users)' /etc/jupyterhub/jupyterhub_config.py
ps -eo user:10,args | grep -E '[j]upyterhub-singleuser|[i]pykernel_launcher' | cut -c1-110
stat -c '%a %U:%G %n' /home/jupyter

Step 8 - Manage users from the admin page
As the administrator, open File > Hub Control Panel in JupyterLab (or browse to http://<your-vm-public-ip>/hub/admin) and choose Admin. The admin page lists every user, whether they are an administrator, when they were last active, and lets you start, stop or open their servers.

The hub's REST API answers on the same address; its root reports the running version:
curl -s http://127.0.0.1/hub/api/
Step 9 - Add your own users
Each hub user is a Linux account on the VM with a hub password. To add one, create the account (it needs no Linux password) and give it a hub password:
sudo useradd -m -s /bin/bash <new-user>
sudo jupyterhub-passwd <new-user>
Then add the name to allowed_users in /etc/jupyterhub/jupyterhub_config.py (add it to admin_users too if they should manage the hub), for example c.Authenticator.allowed_users = {'jupyter', '<new-user>'}, and restart the hub:
sudo systemctl restart jupyterhub
Restarting the hub stops the notebook servers that are running; users start theirs again when they next sign in, and their saved notebooks stay in their home directories. The new user signs in at the same address and gets their own server, running as their own Linux account, in their own home directory.
Step 10 - Install Python packages
The Python environment at /opt/jupyterhub is shared by every user and owned by root, so a %pip install run inside a notebook is refused. Install packages for everyone from your SSH session, then restart the kernel in the notebook to use them:
sudo /opt/jupyterhub/bin/pip install <package>
Security notes
- The hub serves on port 80 over plain HTTP. Restrict
80/tcpin the NSG to trusted networks and put TLS in front of it (for example a certificate on the bundled nginx, or Azure Application Gateway) before you use it over the internet. - The image ships with no usable password. The
jupyteruser's hub password is set on each VM's first boot and kept in the root only file/root/jupyterhub-credentials.txt; change it withsudo jupyterhub-passwd jupyter. Hub passwords are stored as scrypt hashes in/etc/jupyterhub/passwords(root only), and the Linux accounts keep locked passwords, so a hub password never opens SSH orsudo. To remove a user's access, runsudo jupyterhub-passwd --delete <user>. - Only the users in
allowed_usersmay sign in, and onlyadmin_usersmay manage the hub. Anyone who can sign in can run code on the VM as their own Linux user, so give accounts only to people you trust with that. - Notebook servers listen on
127.0.0.1only and are reached through the hub's proxy; the proxy's API and the hub's API are on loopback too. - Keep the VM patched. The image is patched at build time and ships with unattended security upgrades enabled. Python packages in
/opt/jupyterhubare updated withsudo /opt/jupyterhub/bin/pip install --upgrade <package>. Node.js (used only by the hub's proxy) is the official nodejs.org build in/usr/local, so apt does not update it: checknode --versionagainst the Node.js 22 LTS security releases and replace it from nodejs.org when a new 22.x is out.
Support
cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours. If you have any questions about this JupyterHub image or need help with your deployment, contact us through the cloudimg website.