Skip to content

Connecting to JupyterHub from VS Code

Don Jayamanne edited this page Oct 1, 2023 · 8 revisions

The Existing JupyterHub Server... category lists remote JupyterHub servers previously connected. You can also use this option to connect to an existing JupyterHub server, for example http://<ip-address>:<port>/ and paste it in the Enter the URL of the running JupyterHub Server... option to connect to the remote JupyterHub server and executed code against your notebook using that server.

Note: You will need your username and password/API token to authenticate against the JuptyerHub server.

When staring JupyterHub servers, be sure to add the following configuration settings into the JupyterHub config file:

origin = '*'
c.Spawner.args = [f'--NotebookApp.allow_origin={origin}']
c.JupyterHub.tornado_settings = {
    'headers': {
        'Access-Control-Allow-Origin': origin,
        'Access-Control-Allow-Private-Network': 'true', 
    },
}

For more information on this check the following links:

Once connected, all Jupyter KernelSpecs and active Jupyter sessions will appear on this list.

You can start a new Jupyter session from the server's kernelspec by:

  1. Running the Notebook: Select Notebook Kernel command
  2. Choose Select Another Kernel
  3. Choose Existing JupyterHub Server...
  4. Select your server

jupyterHubPreview

Clone this wiki locally