How do I connect VS Code to a cloud GPU over SSH?

Deploy a Raw GPU on CloudGPU, copy the instance’s SSH host, port, user and password, then run Remote-SSH: Connect to Host… in VS Code with ssh -p <port> <user>@<host>; VS Code installs its server on the instance, so your editor, terminal, debugger and notebooks run on the GPU.

Updated 2026-10-27

This guide follows Microsoft’s VS Code Remote Development documentation, read on 2026-10-27, and CloudGPU’s own /deploy, /docs and /api/docs pages, read the same day.

What you need

  • On your computer: VS Code, an OpenSSH-compatible SSH client, and the Remote - SSH extension. VS Code’s docs note that PuTTY is not supported on Windows.
  • On CloudGPU: a balance and an instance from /deploy using the Raw GPU option. Our deploy page describes it as “a raw GPU with JupyterLab + CUDA pre-installed. SSH access, root on a dedicated container, install any Python/CUDA libs you want.” GPU time is billed per minute, rounded up, with a 1-minute minimum, and billing stops when you destroy the instance (see /terms); current rates are on /pricing.

What VS Code’s docs say the remote side needs (read 2026-10-27):

Item What the VS Code docs say Source
Remote OS A running SSH server on x86_64 Debian 8+, Ubuntu 16.04+ or CentOS / RHEL 7+; other glibc-based Linux distributions should work Remote Development using SSH
Remote memory 1 GB RAM required; at least 2 GB RAM and a 2-core CPU recommended same page
Linux prerequisites kernel >= 4.18, glibc >= 2.28, libstdc++ >= 3.4.25, tar; for Remote - SSH also an OpenSSH server, bash, and curl or wget Remote Development with Linux
Not supported Alpine Linux and other non-glibc SSH hosts Remote Development using SSH, Known limitations
Authentication Password authentication is supported; key-based authentication is recommended, and passwords you enter are not stored same page

Which GPU should I pick?

VS Code itself does not use the GPU; your code does. VRAM need depends on model, precision and workflow; see How much VRAM do I need to run an LLM?. Cards listed on /pricing on 2026-10-27 include the RTX 5090 32G, RTX 4090 48G, RTX 4090 24G, RTX 3090 24G, A100 80G, A100 40G, A800 80G, A800 40G, H20 96G and RTX PRO 6000 96G.

Step 1: Deploy a Raw GPU

  1. Open /deploy and choose Raw GPU (under “Need SSH + your own environment?”).
  2. Pick a card and deploy. GPU time is billed per minute, rounded up, with a 1-minute minimum, and billing stops when you destroy the instance (see /terms).

Step 2: Copy the SSH details

Each running instance has an SSH host, port, user and password. Copy them from your instance in the CloudGPU dashboard.

If you script your work, /api/docs documents GET /v1/gpu/instances/{id}, which returns “status, SSH host/port/user/password, api_url, running minutes, cost so far”. The programmatic instance API is only enabled for some accounts; the condition is on /api/docs.

curl https://cloudgpu.app/v1/gpu/instances/<instance-id> \
  -H "Authorization: Bearer $CLOUDGPU_API_KEY"
# when status is "running", read ssh.host, ssh.port and ssh.password

Step 3: Test SSH from a terminal and check the environment

VS Code’s docs say to check that a plain ssh login works before you connect from the editor. Replace the placeholders with your instance’s values:

ssh -p <port> <user>@<host>

Once you are in, check the machine before you install anything:

nvidia-smi              # GPU name, driver version, VRAM
nvcc --version          # CUDA toolkit version
ldd --version           # glibc version (VS Code Server needs glibc >= 2.28)
cat /etc/os-release     # Linux distribution
python3 --version

If nvcc is not found, the CUDA toolkit is probably not on PATH in that shell. Our deploy page says the Raw GPU comes with CUDA pre-installed; find the CUDA install folder on the instance and add its bin directory to PATH.

VS Code does not store passwords you type, so you would retype the password on every connect. VS Code’s Tips and Tricks page sets up a key like this (macOS / Linux; Windows PowerShell commands are on the same page):

ssh-keygen -t ed25519 -b 4096
chmod 400 ~/.ssh/id_ed25519
ssh-copy-id -p <port> -i ~/.ssh/id_ed25519.pub <user>@<host>

-p <port> is added here because a CloudGPU instance gives you a port along with the host. We have not checked whether key login is enabled on every Raw GPU container; if ssh-copy-id works but VS Code still asks for the password, keep using the password. A new instance has a new host and port, so you repeat this step for each one.

Step 5: Add the host and connect from VS Code

Add an entry to ~/.ssh/config on your computer (VS Code can also write it for you via Remote-SSH: Add New SSH Host…):

Host cloudgpu
    HostName <host>
    Port <port>
    User <user>
    IdentityFile ~/.ssh/id_ed25519

Then, following the VS Code docs:

  1. Open the Command Palette (F1) and run Remote-SSH: Connect to Host…, then pick cloudgpu.
  2. If VS Code asks for the remote platform, choose Linux. It stores the answer in the remote.SSH.remotePlatform setting.
  3. VS Code installs VS Code Server on the instance and shows progress; the log is in the Remote - SSH output channel.
  4. Use File > Open… to open your working folder on the instance, for example the SSH user’s home directory.
  5. Open a terminal (Terminal > New Terminal) and run nvidia-smi again. The output should list the GPU you rented, which confirms the terminal runs on the instance.

Step 6: Run Python and notebooks on the GPU

Extensions you install in the remote window run on the instance, not on your laptop.

  1. In the remote window, install the Python and Jupyter extensions from the Extensions view.
  2. Run Python: Select Interpreter and pick the Python environment on the instance that has your libraries.
  3. Create or open an .ipynb file and select a kernel with the kernel picker in the top right, as the Jupyter Notebooks in VS Code page describes.
  4. Check the GPU from a cell, for example !nvidia-smi, or import torch; torch.cuda.is_available() if PyTorch is installed in that environment.

Step 7: Forward ports to your laptop

Anything you start on the instance, such as JupyterLab, a Gradio app or an OpenAI-compatible server, can be reached on your laptop through an SSH tunnel:

  • For one session: run Forward a Port from the Command Palette, or use Add Port in the Ports view. VS Code tells you which localhost port to open.
  • Every time: add LocalForward lines to the same ~/.ssh/config entry, for example LocalForward 8000 127.0.0.1:8000.

If you want to serve a model with vLLM on the same instance, see Rent a cloud GPU for vLLM. We have not checked whether the Raw GPU container’s SSH server allows TCP forwarding; if a forwarded port does not respond, check that first.

Step 8: Back up your work, then destroy the instance

Our /docs say stopped instances release their GPU and you create a new instance to resume; persistent storage across restarts is on the roadmap. Our /terms say all data on local instance storage is permanently deleted when an instance is destroyed. Before you destroy it:

  • git push your code.
  • Copy large results with scp -P <port> <user>@<host>:<path> . from your laptop.

Then destroy the instance from the dashboard. Billing stops when you destroy the instance (see /terms).

Troubleshooting

Symptom What to check Source
Connection hangs or fails Run ssh -v -p <port> <user>@<host> in a terminal and read the Remote - SSH output channel in VS Code Remote Development using SSH
Errors about SSH file permissions Restrict the private key: chmod 400 ~/.ssh/id_ed25519 Tips and Tricks
VS Code Server fails to start Run ldd --version on the instance; VS Code Server needs glibc >= 2.28 Remote Development with Linux
Asked for the password on every connect Passwords are not stored; set up an SSH key (Step 4) Remote Development using SSH
Git pull or sync hangs in the remote window VS Code’s docs list this for SSH keys with a passphrase; clone over HTTPS or run git push from the terminal same page

FAQ

Can I use VS Code with a rented GPU on CloudGPU?

Yes. Deploy a Raw GPU from /deploy, which comes with JupyterLab, CUDA and SSH access as root on a dedicated container, then connect with the VS Code Remote - SSH extension using the instance’s SSH host, port, user and password.

Do I need to install anything on the GPU instance for VS Code?

No manual install is needed for the editor itself. When you connect, the Remote - SSH extension installs VS Code Server on the remote machine. Extensions such as Python and Jupyter are then installed on the remote side from the Extensions view.

Can I run Jupyter notebooks inside VS Code on the cloud GPU?

Yes. In the remote window, install the Python and Jupyter extensions, open or create an .ipynb file and pick a kernel with the kernel picker in the top right. You can also forward the JupyterLab port and keep using it in your browser.

How is the GPU billed while VS Code is connected?

GPU time is billed per minute, rounded up, with a 1-minute minimum, whether or not VS Code is connected, and billing stops when you destroy the instance; see /terms. Current rates are on /pricing.

What happens to my files when I destroy the instance?

Our /terms say all data on local instance storage is permanently deleted when an instance is destroyed, and our /docs say persistent storage across restarts is on the roadmap. Push code to a Git remote or copy results to your laptop before you destroy it.

Sources

Related: /api · /pricing · /deploy · How much VRAM do I need to run an LLM? · Back up your work before you destroy a cloud GPU