Skip to content

Install and launch Jupyter Hub

Don Jayamanne edited this page Sep 26, 2023 · 1 revision

Instructions can be found here:

  1. Create a new folder
  2. Create a file named jupyterhub_config.py and paste the below contents into that file
    1. Custom config to make auth easier, else you need use your login creds, which I guess you don't want to use.
# Configuration file for jupyterhub.

c = get_config()  #noqa
c.JupyterHub.authenticator_class = 'jupyterhub.auth.DummyAuthenticator'
c.DummyAuthenticator.password = "pwd" # Feel free to change the default password
c.Spawner.args = ['--NotebookApp.allow_origin=*']
from jupyterhub.spawner import SimpleLocalProcessSpawner
c.JupyterHub.spawner_class = SimpleLocalProcessSpawner
  1. Create a virtual env in this folder using Python extension
  2. Install Jupyterhub using the CLI python -m pip install jupyterlab jupyterhub
  3. Install the npm package configurable-http-proxy globally via the cli npm i -g configurable-http-proxy
  4. Now start Jupyter Hub using the cli jupyterhub (ensuring the cwd in the terminal is the same folder in step 1 and your virtual env is in the same folder under .venv)
  5. In the browser navigate to Jupyter Hub login page, genrally http://localhost:8000

Note:

  • There is no need to log into JupyterHub

Steps to test

  1. Go into VS Code, open a notebook
  2. From the kernel picker select Existing JupyterHub Server...
  3. Enter the Jupyter Hub Url http://localhost:8000
  4. Follow the prompts to enter the username/password