Skip to content

Compute

code-server

Launch this template and you get a full VS Code window in the browser, running on the rented machine, with the GPU available from its integrated terminal.

The image is grafilab/code-server:4.123.0, Coder’s code-server adjusted to run as root.

  • code-server on port 80, published at https://<your-slug>.instance.grafilab.ai.
  • HOME set to /root, so the editor and the SSH shell share one home directory and one set of dotfiles.
  • GPU passthrough, even though this is an editor: nvidia-smi works in the integrated terminal, and so does anything you install and run there.
  • A root shell over SSH on the same container.

Pick it when you want to edit code where it runs — a repository you are debugging on a GPU, a script that only fails on real hardware — without setting up a local remote-development tunnel. If you would rather use the editor on your own laptop, skip this template and use VS Code’s Remote-SSH against a PyTorch + CUDA instance instead.

Deploy an instance and pick code-server in step 2, Template Selection. The full walkthrough is in Deploy a GPU Instance.

  1. In the console open My Instance and wait until the card reads Active.

  2. Open https://<your-slug>.instance.grafilab.ai. The slug is the three-word name on the instance card. The editor loads straight into a workspace — no sign-in.

  3. Open a folder under /root, or clone a repository in the terminal — the next section.

Open TerminalNew Terminal. You get a root shell in the container, the same one you would reach over SSH.

Terminal window
nvidia-smi
git clone https://github.com/<owner>/<repo>.git

The image is an editor, not a CUDA stack, so install what your project needs:

Terminal window
pip install torch
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"

If you want a ready-made CUDA and PyTorch environment instead of building one, use the PyTorch + CUDA or JupyterLab template and edit over Remote-SSH.

code-server installs extensions from the Open VSX registry, not Microsoft’s Visual Studio Marketplace — Microsoft’s terms restrict that marketplace to Microsoft’s own builds of VS Code. Most open-source extensions are on Open VSX; some Microsoft-published ones, and a few proprietary ones, are not. If a search comes up empty, that is usually why.

Extensions are installed into the container, so they go away with the rental along with everything else.

Start your app on any port in the integrated terminal, binding to all interfaces so the proxy can reach it:

Terminal window
python -m http.server 8080 --bind 0.0.0.0

Port 80 is taken by the editor itself, so a second service needs its own public URL. In the console open Web Access on the instance card, add a mapping with a Service Name and the Port your app listens on, and use the proxy URL it generates — https://<your-slug>-<service>.instance.grafilab.ai. The full procedure is in Manage Instances.

Anyone with the URL can reach your web UI

The Grafilab proxy does not add a login in front of your instance. Your random three-word slug (https://<your-slug>.instance.grafilab.ai) is the only barrier, and the shipped web templates have no application login of their own (Open WebUI is the exception). Treat the URL like a password: don’t paste it in public places, and if you need a lock, add one inside the app over SSH.

On this template the exposure is total: the URL is a root terminal. Treat it as a secret, don’t leave the instance running longer than you need it, and don’t paste the URL into a shared channel.

For a real lock, code-server supports --auth password, which reads the password from the PASSWORD environment variable or from password in ~/.config/code-server/config.yaml. Applying it means restarting the server with that setting, which you do over SSH.

Nothing persists past the rental

Instances have no persistent volume. Anything you write at runtime — downloaded models, installed packages, notebooks, outputs — lives in the container for the lifetime of the rental and is gone when it expires. Before Expire at, back up the folders you care about to Grafilab storage and download the archive.

Everything under /root — your workspace, your extensions, your shell history — is inside the container. Push code to git as you work, and use Backup on the instance card for anything that isn’t in a repository.