Skip to main content
Apidly Cloud
Cookie policy

Analytics and ad cookies stay off unless you accept. Cookie policy

We would like to use Google Analytics and Microsoft Clarity to understand how the public pages are used, including page views and session recordings, and the Reddit Pixel to measure whether our ads on Reddit lead to visits and sign-ups. You choose here whether they are on. Rejecting changes nothing about how the site works.

Code on a GPU with VS Code in your browser

Start the VS Code in the browser template, sign in with the password from the Connect tab, check the GPU in the built-in terminal and run Python on it.

Last updated November 23, 20264 min read
View as Markdown

You will get a full Visual Studio Code editor in a browser tab, running on a rented GPU server with PyTorch and the CUDA tools installed. You edit files, use the built-in terminal and run your code on the GPU, and nothing is installed on your own computer. The VS Code in the browser (GPU) template runs code-server, open-source software under the MIT licence. This guide is for people who write Python or AI code and want a GPU without setting up SSH. You need an account with credit; you do not need an SSH key.

If you already use VS Code or Cursor on your own computer and have an SSH key, you can also connect them to any server: see VS Code and Cursor.

What it costs

You pay for the server by the second while it runs, plus its disk for as long as the server exists, also while it is stopped. The review step shows the price Per hour before anything starts; the pricing page has the current prices of every GPU.

1. Start the server

Never started a server? Your first GPU server shows adding credit and Quick start step by step. If a notebook is enough for you, Quick start's Run a notebook is the shortest path. For the editor:

  1. Open Deploy. Under Sort by, choose Price, low to high and pick a configuration with at least 8 GB of VRAM (12 GB is recommended). Select Continue.
  2. Above the template cards, select Notebooks and coding, then the VS Code in the browser (GPU) card, then Continue. RTX 50-series GPUs are not supported by this template yet; the card says so when you picked one.
  3. Name the server, for example gpu-editor. Leave CODE_PASSWORD empty: the platform creates a password for this server.
  4. Select Continue, check Per hour and keep the automatic stop under Automation (optional) on for a first try. Select Start my server.

Some new servers are reviewed by our team before they start; you are not charged until the server runs.

2. Sign in

  1. When the server is running, open Servers, select it and open the Connect tab.
  2. Under Sign in with, press the eye button next to Password and copy it.
  3. Select Open app. The editor opens in a new browser tab and asks for the password. Paste it.

On the first start the editor downloads before it answers; if the page does not load yet, wait a minute and reload it.

3. Check the GPU

Open the terminal in the editor (menu Terminal, then New Terminal) and run:

nvidia-smi
python -c "import torch; print(torch.cuda.is_available(), torch.cuda.get_device_name(0))"

The first command shows the GPU and its memory. The second prints True and the GPU's name.

4. Write and run code

The editor opens the /workspace folder, which is on the server's disk. Create a file hello_gpu.py there:

import torch

x = torch.rand(4000, 4000, device="cuda")
y = x @ x
print("Result on", y.device, "sum:", y.sum().item())

Run it in the terminal with python hello_gpu.py. To bring files in, drag them from your computer into the file explorer on the left; to take a file home, right-click it and choose Download.

Extensions come from the Open VSX registry, which has most popular ones, including Python and Jupyter. A few extensions published only in Microsoft's marketplace are not available there.

Common mistakes

  • Wrong password: if you set CODE_PASSWORD yourself, the Connect tab does not show it; use the one you chose.
  • Files outside /workspace are gone after a restart: only the disk under /workspace is kept. Save your projects there.
  • Packages you installed are missing after a restart: install them into a virtual environment inside /workspace, or keep a requirements.txt there and reinstall.
  • "CUDA out of memory": your model or batch is too big for the GPU. Use a smaller batch, or a configuration with more VRAM; see Which GPU do I need?

Keep it private

The editor uses plain http, and anyone who has the address and the password can use your server and its terminal. Keep the password to yourself and do not paste secrets into files you share.

When you are done: stop or destroy

  • Stop ends the compute charge. Your files in /workspace are kept, and the disk is still billed.
  • Destroy ends every charge and deletes the disk with your files. Open the server, go to Settings and choose Destroy server.

Next

Ready to try it?

Create a free account and add credit when you want to start a server. The smallest top-up is $10.

Create a free account

Was this helpful?

Still stuck? Contact us