For the complete documentation index, see llms.txt. A markdown version of this page is at /guides/run-vscode-in-browser/index.md.

Run VS Code in a browser on a workstation

Build a workstation with VS Code in your browser from one YAML file you can commit beside your code.

Build a workstation with VS Code in your browser from one YAML file you can commit beside your code. A bare Workstation gets you a clean Linux workstation. This guide adds Node.js, VS Code Web and port forwarding to it.

Prerequisites

  • Ringleader installed, and a workstation built once, as Quickstart shows.
  • The examples use a workstation named ide-box and a WorkstationConfig named ide. The file below creates them. Replace the names with yours.

Write the workstation file

The file below boots a Debian workstation with Node.js and VS Code Web (code-server) started on port 8080, and forwards that port to your computer, so the IDE opens at http://127.0.0.1:8080. Save it as ide-box.yaml:

apiVersion: workstations.ringleader.dev/v1
kind: WorkstationConfig
metadata:
  name: ide
spec:
  # Attach to every Workstation in this namespace labeled tier: dev.
  selector:
    matchLabels:
      tier: dev
  priority: 100

  image:
    os: linux
    distribution: debian
    version: "13"

  # The login shell for the workstation's user.
  identity:
    shell: /bin/bash

  # Packages. A bare name is an OS package. An object adds a type (system, npm,
  # pypi, go or mise) and optionally a version and updatePolicy.
  packages:
    - git
    - name: curl
      updatePolicy: latest

  # Ready-made install recipes for common tools.
  devtools:
    - name: nodejs
    - name: vscode-web   # code-server

  # Settings for tools once they are installed. Serve code-server on port 8080
  # with no password, as explained below the file.
  toolconfigs:
    - id: vscode-web
      name: vscode-web
      config:
        port: 8080
        auth: none

  # Ports the workstation listens on.
  ports:
    - 8080

  # Unattended security upgrades (Debian: unattended-upgrades).
  securityUpdates: true

  # Ports are not forwarded unless you ask. This forwards every port the
  # workstation listens on, including 8080, to the same port on your computer.
  # Ringleader sets it up once, when the workstation first reaches Running.
  defaultLocalBinding:
    enabled: true
    autoForward:
      forwardAll: true
---
apiVersion: workstations.ringleader.dev/v1
kind: Workstation
metadata:
  name: ide-box
  labels:
    tier: dev          # matches the `ide` config's selector
spec:
  # VM size. It goes on the Workstation only (see the note below).
  providerConfig:
    memory: 6   # GiB
    cpus: 2

A WorkstationConfig, like ide, is a reusable layer of settings: image, packages, devtools, ports, identity and more. A Workstation, like ide-box, is one workstation. It can carry settings itself, but usually it gets them from layers.

The ide layer reaches ide-box because its selector names the tier: dev label that ide-box carries. Configuration layers explains the other way to attach a layer, by name, and how Ringleader merges several.

providerConfig goes on the Workstation

Most fields merge from configuration layers, but providerConfig comes from the Workstation spec only. Put VM sizing (memory, cpus) and cloud providerConfig.gcp settings directly on the Workstation. rl apply rejects a WorkstationConfig that sets providerConfig.

Apply the file

Installing Node.js and code-server downloads them over the network, which takes a few minutes on a fresh VM. The workstation reports Configured once it has installed them.

The file names no namespace, so rl apply puts both resources in your current namespace. That is local until you sign in to the Ringleader console or run rl namespace use. To use local while you are signed in, run rl namespace use local before you apply the file. Namespaces and resolution explains how rl chooses.

  1. Apply the file:

    rl apply -f ide-box.yaml
  2. Wait for the workstation to report Configured:

    rl workstation wait ide-box --for condition=Configured --timeout 15m

The same file is in our examples on GitHub, so you can also apply it without writing the file:

rl apply -f https://raw.githubusercontent.com/ringleader-dev/ringleader-examples/main/getting-started/03-browser-ide/ide-box.yaml

Open the IDE

Open http://127.0.0.1:8080 in your browser.

The IDE asks for no password. The forward that reaches it listens only on your computer’s loopback address, 127.0.0.1, so other computers on your network cannot open it.

If a browser IDE is all you wanted, you are done.

Keep the file with your code

Keep the file in your project’s repository, next to the code it supports, for example in a deploy/ or .ringleader/ folder, and commit it. Anyone on the team can then rl apply -f the same file and get the same workstation, and a change to the environment shows up as a diff in a pull request.

Any path works. rl apply reads the file you give it, and Ringleader stores the workstation and its configuration, not the file.

Next steps