# Connecting to Jupyter notebook with VS Code

Accessing your Jupyter notebook running on the DataCrunch server through VS Code may be handy to benefit from advanced code-editor features, such as static code analysis and AI-based co-pilots.

The easiest way to start an instance for use with Jupyter is to choose JupyterLab when selecting the Operating System:

<figure><img src="https://2529223994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYO2RW7i8v8Hs8UzxSAdO%2Fuploads%2FUg7ggySflDnQZx7HjzoT%2FOS%20jupyter.png?alt=media&#x26;token=1de5a56d-b543-4c17-a302-eef712765ce8" alt=""><figcaption></figcaption></figure>

Proceed to deploy your instance as usual. After your instance has been created, you will need to secure it by following the guide to [securing-your-instance](https://docs.datacrunch.io/~/revisions/QH6oBN8psmEkq1hpbta0/cpu-and-gpu-instances/securing-your-instance "mention").

To access your Jupyter server after securing the instance, you will need to forward the local port `8888` (or any other port that you would like to use for connecting to Jupyter) to the remote port `8888`:

```bash
ssh -L 8888:localhost:8888 root@IP_OF_YOUR_INSTANCE
```

After this is done, you should have Jupyter access on your desktop at: <http://127.0.0.1:8888/> \
The authentication token (password) for your Jupyter instance can be obtained from the *Open JupyterLab* link in your server description:

<figure><img src="https://2529223994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYO2RW7i8v8Hs8UzxSAdO%2Fuploads%2FfEVLGm1DQTIrpkNGhTNC%2Fjupyterlab.png?alt=media&#x26;token=365c0228-b8b0-4adb-a459-8dbd3912be70" alt=""><figcaption></figcaption></figure>

The link is of the form `http://SERVER_IP:8888/?token=AUTHENTICATION_TOKEN`. You will need this token to access your Jupyter kernel in the next step.

Now you can connect the VS Code to the local port you just configured. Make sure the Jupyter extension is installed. Then create a new `*.ipynb` notebook locally and select a remote kernel. Paste <http://127.0.0.1:8888> into the kernel URL, and enter the authentication token when prompted for the password.

You should now be able to run code on your remote machine through VS Code.
