Connecting VSCode to JupyterHub
1
Install the JupyterHub extension
Install Microsoft’s JupyterHub extension for VSCode. You can install the extension directly in VSCode or from the CLI:
- Open VSCode.
- Open the extensions menu.
- Search for and install Microsoft’s JupyterHub extension:
ms-toolsai.jupyter-hub
.

By default, Microsoft’s Jupyter extension for VSCode collects usage data and sends it to Microsoft. However, you can disable this telemetry reporting, if necessary. For more information, see Microsoft’s privacy statement.
The JupyterHub extension also installs:
Extension | ID |
---|---|
Jupyter | ms-toolsai.jupyter |
Jupyter Keymap | ms-toolsai.jupyter-keymap |
Jupyter Notebook Renderers | ms-toolsai.jupyter-renderers |
Jupyter Slide Show | ms-toolsai.vscode-jupyter-slideshow |
Jupyter Cell Tags | ms-toolsai.vscode-jupyter-cell-tags |
2
Generate a JupyterHub API token
To authenticate VSCode with JupyterHub, you need an API token:
-
Open a browser and navigate to your JupyterHub dashboard URL:
https://<YOUR_JHUB_DOMAIN>/hub/token
. -
Enter a brief, descriptive note about your token’s use.
Defaults to “Requested via token page” if not provided.
- Select an expiration date for your token.
- Leave the Permissions box empty.
- Select Request new API token.
- Copy your new API token and save it in a secure location. You won’t be able to see it again.
3
Connect VSCode to JupyterHub
- Open VSCode.
- Open the File menu and select New File….
-
Select Jupyter Notebook from the available options.
-
Open the Select Kernel menu and select Existing JupyterHub Server….
- Enter the URL of your JupyterHub server.
- Enter your JupyterHub username.
- Paste the API token you generated earlier to authenticate VSCode to the server.
- (Optional) Set the name of your JupyterHub connection.
- VSCode establishes a connection to the remote JupyterHub kernel and provides you with a list of available kernels to use. Select the kernel you want your local notebook to use.
4
Verify
Verify the kernel is running on the remote server by running 
!hostname
in the first cell. This prints the IP address of the JupyterHub server.
Troubleshooting
VSCode says my JupyterHub server URL is invalid
Cause
Cause
If you receive an “Invalid JupyterHub URL specified” error message when you attempt to connect to your JupyterHub server, it is likely the issue is related to SSL validation between VSCode and your JupyterHub server.

Solution
Solution
How you resolve the error depends on the type of certificate in use:
- DIY-SSL-CA certificates (provided with the installer): These certificates are intended for quick setup and testing. If you are using these certificates, replace them with trusted third-party certificates.
- Self-signed certificates from a privately-managed CA: If your organization manages its own certificate authority, add that CA to your local machine’s certificate bundle so that VSCode can validate the server connection.