JupyterHub Installation and Configuration
Obtain administrative rights by requesting root access:
sudo -iInstall the package for JupyterHub
conda install -c conda-forge jupyterhubGenerate a JupyterHub configuration file in /etc by:
mkdir /etc/jupyterhub/
cd /etc/jupyterhub/
jupyterhub --generate-configUse nano to edit the newly created configuration file:
nano /etc/jupyterhub/jupyterhub_config.pyCopy and paste the following into the configuration file:
# Allow Jupyter Lab as the default interface
c.Spawner.default_url = '/lab'
# Allow admin to access other users' accounts
c.JupyterHub.admin_access = True
# Specify JupyterHub administrators
c.Authenticator.admin_users = {'admin1'}
# Shutdown user servers on logout
c.JupyterHub.shutdown_on_logout = True
# Prevent the user-owned configuration files from being loaded
c.Spawner.disable_user_config = TrueUse CTRL+O then enter to overwrite the document and CTRL+X to exit.
💡 For having access to the JupyterHub admin interface, at least one administrator has to be specified in the configuration file, e.g. admin1. Additional administrators can be assigned/removed from the JupyterHub admin interface by existing administrator.
Make JupyterHub a system service, so that JupyterHub will run at system startup and continue to run after the system administrator logs out. To do so, create a service file:
Copy and paste the following into the document as depicted below:
Use CTRL+O then enter to overwrite the document and CTRL+X to exit.
Link the newly created service file to the /etc/systemd/system directory:
Reload the system daemon and run JupyterHub as a system service:
Check JupyterHub status (optional):
💡 Your JupyterHub server should be up and running at http://<your instance IP address>:8000. Make sure that :8000 is included in your address. See Add a Custom Domain to attach your JupyterHub to a registered domain name instead.
Last updated