Kaggle’s notebook interface is limiting once a project outgrows a few cells. Connecting over SSH gives you the full VS Code experience against Kaggle’s GPUs: integrated terminal, breakpoint debugging, and a normal file-based project layout.
It also lets you stretch GPU quota. The default is 30 hours per week — if you stop the notebook session near the end of hour 29 and SSH back in, you get roughly 12 more hours, for about 42 hours a week.
And plenty more to explore once you are in.
The Kaggle notebook clones this repository and runs three small scripts — see SCRIPTS_GUIDE.md for the details of each:
| Script | Does |
|---|---|
install_ssh_server.sh |
Sets the root password and installs OpenSSH + ngrok |
add_ngrok_token.sh |
Registers your ngrok auth token |
run_ssh_server.sh |
Opens an ngrok TCP tunnel to port 22 |
2.1 Open the notebook: Notebook Example
— or upload notebook_example.ipynb from this repository.
2.2 Choose Copy & Edit:

2.3 In the right-hand sidebar, pick one of these two GPUs:

⚠️ Warning: TPU is not supported.
2.4 Under persistence, select Files only so your files survive each Stop Session:

2.5 Go to Ngrok → Your Authtoken → press copy:

2.6 In cell 3 (the setup cell), set your SSH password and paste your Ngrok token:
ssh_password = "kaggle" # Change this to your desired password
# Run bash scripts
!bash install_ssh_server.sh $ssh_password
!bash add_ngrok_token.sh YOUR_NGROK_TOKEN # Replace with your actual token
2.7 In the last cell (cell 4 — runs bash run_ssh_server.sh), note the HostName and
Port from the ngrok output, e.g. 0.tcp.ap.ngrok.io and 17520. You need both in step 3.6.

3.1 Press Ctrl+Shift+X, search for SSH, and install these two extensions:

3.2 For background on how Remote-SSH works, see the VS Code Remote-SSH docs.
3.3 Press Ctrl+Shift+P → Remote-SSH: Connect to Host…

3.4 Press Configure SSH Host…

3.5 Select ~/.ssh/config — usually the first entry in the list.

3.6 Add this block to the config file:
Host Kaggle
HostName 0.tcp.ap.ngrok.io
Port 17520
User root
| Field | Value | Where it comes from |
|---|---|---|
Host |
Kaggle |
Any name you like |
HostName |
0.tcp.ap.ngrok.io |
Step 2.7 |
Port |
17520 |
Step 2.7 |
User |
root |
Always root |
3.7 Press Ctrl+S, then
Ctrl+Shift+P → Remote-SSH: Connect to Host…

3.8 Pick the host you just named — Kaggle:

3.9 When prompted, enter the password you set in step 2.6 (default: kaggle).
3.10 Press continue:

💡 Tip: If VS Code asks you to choose the operating system, select
linux.
3.11 The bottom-left corner confirms the connection:

4.1 Press Ctrl+K O, enter the path /kaggle, press ok.

4.2 Open a terminal with Ctrl+J. The system python already
carries the full Kaggle stack (torch, numpy, …), so you can start working right away.
uv is preinstalled for anything you need to add:
uv pip install --system <package>
Prefer an isolated environment? Create it with --system-site-packages so it can still
see the preinstalled Kaggle packages:
uv venv --system-site-packages .venv
source .venv/bin/activate
uv pip install <package>
⚠️ Warning: a plain
uv venv, without--system-site-packages, starts empty —import torchfails inside it. And outside a virtual environmentuv pip installneeds the--systemflag, otherwise it exits withNo virtual environment found.
4.3 Activate CUDA. The image already ships the driver — it is simply missing from the SSH shell’s environment, because that shell does not inherit the notebook kernel’s paths. Two exports fix it instantly, with no download:
export PATH=/opt/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/nvidia/lib64:$LD_LIBRARY_PATH
They apply to the current shell only — append them to /root/.bashrc if you open
several terminals, and redo them after each Stop Session.
📝 Fallback: if those paths move in a future Kaggle image, installing the driver utilities works too — it just downloads a few hundred MB, and also has to be repeated after every Stop Session:
sudo apt install nvidia-utils-515 -y
4.4 Check the GPU is visible:
nvidia-smi

💡 Tip: If
nvidia-smireports no devices, the session has no GPU attached at all — check theAcceleratorsetting from step 2.3.
4.5 After each Stop Session, you only need to redo a subset:
print debugging..py files and import across them, like a normal project.The Data panel on the right has two sections, and they map to different paths with
different rules:
| Section | Path | Writable | Size limit |
|---|---|---|---|
| Input | /kaggle/input/... |
❌ Read-only | ~107 GB private, unlimited public |
| Output | /kaggle/working/... |
✅ Your workspace | ~20 GB |

With Remote-SSH Kaggle and Visual Studio Code you get the full weight of Kaggle’s GPUs behind a development environment you actually enjoy using — a real terminal, a real debugger, and a normal project layout. Set it up once and the only thing you repeat between sessions is step 4.5.