# Basics

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> A workstation is a Linux virtual machine that Ringleader builds from a description you write, and reconfigures when you change that description.


A workstation is a Linux virtual machine that Ringleader builds from a description you
write, and reconfigures when you change that description. It runs on your computer or in
your cloud account.

Because Ringleader builds the workstation from its description, you can delete a
workstation and get an identical one back. You can give a teammate or a coding agent the
same environment from the same description. And to change a workstation, you edit its
description instead of logging in to change it.

This page explains the parts of a workstation and how they fit together. To build one,
follow the [Quickstart](https://docs-stg.ringleader.dev/quickstart/). Every
field is in the [Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/) reference.

## Workstation description and status

A workstation's `spec` is the description you write: the operating system, the tools, the
code and the settings. Ringleader writes its `status`, which reports what is true now, such
as whether the workstation is running and which configuration it has applied. You never
edit the status.

Each workstation also belongs to a namespace: a named group of resources, such as `local`,
which keeps a workstation on your computer.

## Configuration sources

A workstation's configuration can come from more than its own description. A
[WorkstationConfig](https://docs-stg.ringleader.dev/reference/resources/workstationconfig/) is a reusable
configuration layer, such as a team's baseline or your own preferences. It attaches to a
workstation by label, or by name when the workstation lists it in `spec.configs`.

Ringleader merges every WorkstationConfig that attaches to a workstation into the
workstation's own description, in order of each layer's `priority`, lowest first. The
result is the workstation's effective configuration. To see it, run
`rl workstation get-resolved-configuration`
with the workstation's name,
as [Configuration merging and resolution](https://docs-stg.ringleader.dev/workstations/configuration/configuration-merging-resolution/) describes.
[Configuration layers](https://docs-stg.ringleader.dev/workstations/configuration/configuration-layers/)
explains which layer wins, and whose workstations a layer can reach.

## Configuration delivery and order

On your computer, [`rl daemon`](https://docs-stg.ringleader.dev/reference/cli/commands/daemon/), a background service,
creates and starts the workstations that run there. On a Mac or a Windows PC, the
Ringleader application starts `rl daemon` for you. Ringleader's own service, not
`rl daemon`, creates the workstations in your cloud account.

Inside each workstation, a Ringleader program called the in-VM agent applies the effective
configuration and reports what it did. For a workstation on your computer, `rl daemon`
sends the configuration to the in-VM agent over SSH. For a workstation in your cloud
account, the in-VM agent connects out to Ringleader and fetches it.

The in-VM agent applies the parts of a configuration you declare in this order:

1. The user account.
2. Package repositories, then system packages, then security updates.
3. Devtools, then npm, PyPI, Go and mise packages.
4. Tool configuration.
5. Tailscale.
6. Files, environment variables and shell dotfiles.
7. System settings: the hostname, time zone, locale, kernel settings and limits.
8. The SSH host keys the workstation trusts, then code sources, then your dotfiles
   repository.
9. Scripts, then services.

So when your scripts run, everything before them is in place: packages, tools, files and
your code. Services start after the scripts.

## Workstation phases

A workstation moves through phases as Ringleader creates it, stops it and starts it. Its
`status.phase` shows the current one.

*Diagram: A workstation starts at Pending, then Provisioning, PostInstall and Running. From Running, a spec change moves it to Reconfiguring and back to Running; setting spec.stopped moves it to Stopping and then Stopped. From Stopped, a start moves it to Starting and back to Running.*

```mermaid
stateDiagram-v2
  direction TB
  [*] --> Pending
  Pending --> Provisioning
  Provisioning --> PostInstall
  PostInstall --> Running

  Running --> Reconfiguring: spec change
  Reconfiguring --> Running

  Running --> Stopping: spec.stopped set
  Stopping --> Stopped
  Stopped --> Starting: start
  Starting --> Running
```


`Stopping` and `Starting` last as long as the power operation does. The workstation stays in
the phase until Ringleader confirms it is down, or back up. `Starting` means an existing
workstation is powering on, while `Provisioning` means Ringleader is creating a new one.

## Other resources a workstation uses

Other Ringleader resources give a workstation credentials and shared services, filter what
it connects to, or forward its ports to your computer. The diagram shows how they relate.

*Diagram: A Workstation at the center. An Integration becomes a generated WorkstationConfig, and names a key in a Secret. A WorkstationConfig reaches a Workstation by label, or by name in spec.configs. An Edge enforces the Workstation's egress policy and adds the Secret's key to its requests. A CloudIdentity builds the edge instance, the Edge's virtual machine in your cloud account. It also provides cloud credentials to the Workstation, and points at a CloudAccount, your organization's cloud account, by cloudAccountRef. The Workstation's template creates a LocalBinding, a forward to your computer, when the Workstation first reaches Running.*

```mermaid
flowchart TB
  Integration["<b>Integration</b><br/>one named endpoint"]
  Secret["<b>Secret</b><br/>keys and tokens"]
  Config["<b>WorkstationConfig</b><br/>a reusable configuration layer"]
  Workstation["<b>Workstation</b><br/>spec &rarr; status + conditions"]
  Edge["<b>Edge</b><br/>filters outbound traffic"]
  CloudIdentity["<b>CloudIdentity</b><br/>per-provider credentials"]
  CloudAccount["<b>CloudAccount</b><br/>your organization&rsquo;s cloud account"]
  LocalBinding["<b>LocalBinding</b><br/>a forward to your computer"]

  Integration -- "becomes a generated<br/>WorkstationConfig" --> Config
  Integration -- "names a key in" --> Secret
  Config -- "by label, or by<br/>name in spec.configs" --> Workstation
  Secret -- "key added<br/>to requests" --> Edge
  Edge -- "enforces egress,<br/>adds keys" --> Workstation
  CloudIdentity -- "builds the<br/>edge instance" --> Edge
  CloudIdentity -- "provides<br/>cloud<br/>credentials" --> Workstation
  CloudIdentity -- "cloudAccountRef" --> CloudAccount
  Workstation -- "its template creates<br/>one when first Running" --> LocalBinding
```


Apart from WorkstationConfig, which is described above, each resource in the diagram does
one job:

- An [Integration](https://docs-stg.ringleader.dev/reference/resources/integration/) connects workstations to a
  shared service, such as an LLM gateway or an MCP server. Ringleader turns it into a
  generated WorkstationConfig, which attaches like any other.
- A Secret holds a key or a token, such as an API key, that an Integration names.
- An [Edge](https://docs-stg.ringleader.dev/reference/resources/edge/) applies a workstation's egress policy: the
  rules for which hosts it may connect to. It also adds the keys that the workstation's
  `httpProxy` Integrations name to its requests, so those keys are never on the
  workstation.
- A [CloudIdentity](https://docs-stg.ringleader.dev/reference/resources/cloudidentity/) gives Ringleader the
  short-lived credentials it creates a cloud workstation with. Ringleader picks it by the
  workstation's provider and labels.
- A [CloudAccount](https://docs-stg.ringleader.dev/reference/resources/cloudaccount/) links your organization to one
  cloud account. Ringleader signs in to that account with a short-lived, signed assertion
  the account trusts, so it stores no cloud credential.
- A [LocalBinding](https://docs-stg.ringleader.dev/reference/resources/localbinding/) forwards a port or a socket
  from a workstation to your computer. When a workstation first reaches `Running`,
  `rl daemon` creates one from the workstation's `spec.defaultLocalBinding` template.

You don't attach an Edge to a workstation. In your cloud, the Edge for the workstation's
namespace, cloud and region serves it. On your computer, with no Edge, Ringleader's network
process for the workstation does the same work.
[Set up one Edge for two teams](https://docs-stg.ringleader.dev/guides/set-up-edge/)
shows a policy and an added key together.

## Providers

A provider is the part of Ringleader that runs a workstation, as a virtual machine on your
computer or in your cloud account. Workstations come in three kinds, which differ in where the
virtual machine runs, where the workstation's record lives and who runs it:

| Kind | Providers | Where it runs | Where its record lives | Who runs it |
| --- | --- | --- | --- | --- |
| Local workstation (the `local` namespace, or no login) | vz (Mac), hcs (Windows), qemu (Linux) | Your computer | Your computer only | Your computer |
| Node-bound workstation (a local provider in a namespace Ringleader holds) | The same three | Your computer | Ringleader, with a field naming your computer | Your computer. Ringleader stores the record but doesn't run the workstation. |
| Cloud workstation | gcp, aws, azure | Your cloud account | Ringleader | Ringleader |

A workstation names its provider and operating system image in its file, as
[Provider settings](https://docs-stg.ringleader.dev/workstations/configuration/provider-settings/) explains.

### Local workstations

A local workstation runs on your computer, on the local provider for your system: vz on a Mac,
hcs on Windows or qemu on Linux. A workstation that names no provider runs on it, so you name a
provider mainly to run in your cloud. [Mac workstations (vz)](https://docs-stg.ringleader.dev/workstations/providers/mac/) and
[Windows workstations (hcs)](https://docs-stg.ringleader.dev/workstations/providers/windows/) say what each provider needs.

<div class="callout callout-note">
  <p class="callout-title">The provider is fixed at creation</p>
  <div class="callout-body">
    A workstation keeps the provider it was created on, even if your computer&rsquo;s default changes
later. It can&rsquo;t move to another provider. To switch, delete the workstation and create it
again. Its <code>status.provider</code> shows the provider it runs on.
  </div>
</div>


#### Default local provider

Each computer has one default local provider: vz on a Mac, hcs on Windows and qemu on Linux.
A workstation that names no provider runs on it. `rl status` marks which provider is the
default, and says why when your computer can't run it.

If your computer can't run its local provider, it has no default. `rl workstation create` then
refuses a workstation that names no provider.

#### Storage of a new local workstation

To keep a new local workstation on your computer alone, create it in the `local` namespace.
That works whether or not you're logged in, and Ringleader never sees the workstation.

In any other namespace, `rl` creates a new local workstation at Ringleader, bound to your
computer, as a node-bound workstation, or refuses it. It refuses the workstation while you're
logged out, in a namespace that exists only on your computer, and when you pass `--to self`. A
node-bound workstation runs on any of the local providers these docs cover: vz, hcs or qemu. You
can't create one from the Ringleader console, because the console runs on no computer of yours.

When `rl` can't create the workstation at Ringleader, it stores nothing and prints one sentence
saying why. [New workstation refused](https://docs-stg.ringleader.dev/troubleshooting/#new-workstation-refused)
lists each sentence and what to do. Fix the cause, then create the workstation again.

### Node-bound workstations

A node-bound workstation (preview) is a local workstation, a virtual machine on your computer,
whose record Ringleader keeps. It runs only on the computer that created it. Its `spec.node`
names that computer's node, the computer's registration with Ringleader, which is where the
name comes from. Whether a workstation is node-bound depends on its namespace, not on a
separate setting.

Before node-bound workstations, a local workstation was stored only on the computer that ran
it, so the console, your other devices and your teammates couldn't see it. Its agent sessions
stayed with it. A node-bound workstation fixes that:

- One record is read by the console, `rl`, the terminal UI and the application.
- Its [agent sessions](https://docs-stg.ringleader.dev/workstations/sessions/agent-sessions/) and [terminal sessions](https://docs-stg.ringleader.dev/workstations/sessions/terminal-sessions/) follow the workstation, so you can open them from the console
  or another device.
- Teammates can see it.
- Ringleader enforces its name, quota and permissions as for a cloud workstation.
- You can take one over with `rl workstation adopt`, and copy a teammate's to your own computer
  with `rl workstation copy --node self`.

The trade-off is that your computer needs Ringleader for most commands, as
[Node-bound workstations while Ringleader is unreachable](#node-bound-workstations-while-ringleader-is-unreachable)
describes. Nothing turns a workstation stored on your computer into a node-bound one. To have
a workstation at Ringleader, create a new one there, as
[Create a node-bound workstation](#create-a-node-bound-workstation) shows. A workstation that an
earlier release stored on your computer in a namespace other than `local` stays there, and
[Workstation created before node-bound workstations](https://docs-stg.ringleader.dev/troubleshooting/#workstation-created-before-node-bound-workstations)
says what `rl` shows on it.

#### Visibility of a node-bound workstation

A node-bound workstation follows the same rules as a cloud workstation in its namespace:

- Its name is unique in the namespace.
- It counts toward the namespace's workstation limit.
- It receives its Secrets from Ringleader.
- Everyone who can read the namespace can read its record, which carries no folder, port or
  address of your computer.

You can't share a node-bound workstation with a teammate through a Grant, because their
computer can't reach a virtual machine on yours.

`rl get workstations` adds a **DEVICE** column whenever it lists a node-bound workstation, and
`rl describe workstation` prints **Device** and **Activity** lines. You, and anyone who
administers workstations in the namespace, see the computer's name and whether it is active.
For example: `my-laptop (Active)` or `my-laptop (Last active 3d ago)`. Everyone else sees
`a member's device`. `rl tui` shows the same words in a **DEVICE** column on its Workstations
tab, and so does the Ringleader application on its **Workstations** page.

#### Permissions on a node-bound workstation

What you can do depends on where you are:

| From | What you can do |
| --- | --- |
| The computer that runs it | Everything, as with any local workstation. |
| Another of your devices | Stop, start, restart, edit and delete it. `rl shell`, `rl tmux`, `rl code`, `rl file cp`, `rl logs` and `rl troubleshoot` refuse and name the computer that runs it, and `rl tui` refuses the matching keys in its status line. |
| The Ringleader console, as its owner | Stop, start, restart, delete, and edit the spec as JSON. |
| The Ringleader console, as anyone else | View it, and delete it if you may delete workstations in the namespace. |

Say the computer that runs it isn't active. `rl workstation stop`, `start`, `restart`,
`rl edit workstation` and `rl workstation delete` then say that the change takes effect once
that computer is back.

Some workstations can reach your computer's own `127.0.0.1` whatever their settings say, as
[Loopback reach](https://docs-stg.ringleader.dev/workstations/connectivity/host-access-loopback/#loopback-reach) lists. Only the computer that runs such a workstation can edit
it. Stop, start, restart and delete still work from anywhere, and the console offers no Edit for
it.

#### Node-bound workstations while Ringleader is unreachable

A running node-bound workstation stays reachable while your computer can't reach Ringleader, and
after you log out. `rl shell` and the SSH aliases from
[`rl ssh-config`](https://docs-stg.ringleader.dev/reference/cli/commands/workstation-access/#rl-ssh-config) keep working, because your
computer keeps its own record for them. Every other command that needs Ringleader fails with a
sentence that says so, and nothing is queued to send later.

### Cloud workstations

A cloud workstation runs as a virtual machine in your organization's cloud account, on gcp, aws
or azure. It always names its provider, lives in a namespace on Ringleader and is created and
run by Ringleader's own service. A CloudIdentity gives Ringleader the credentials to create it.
[Cloud workstations (GCP, AWS, Azure)](https://docs-stg.ringleader.dev/workstations/providers/cloud/) covers what
it needs and how to create one.

## Create a local workstation

To create a workstation that runs on your computer, name it and put it in the `local`
namespace:

```bash
rl workstation create my-local-box -n local
```

Your computer builds and starts the virtual machine, and the workstation is stored on your
computer alone. Add `--cpus`, `--memory` and `--disk` to size it, and `--wait` to have the
command wait until the workstation is ready. For the full walk-through, follow the
[Quickstart](https://docs-stg.ringleader.dev/quickstart/). To confirm it works, go to
[Check that a workstation is ready](#check-that-a-workstation-is-ready).

## Create a node-bound workstation

To create a node-bound workstation, follow these steps:

1. Log in to Ringleader:

   ```bash
   rl auth login
   ```

2. Create a local workstation in a namespace Ringleader holds, such as `team`:

   ```bash
   rl workstation create my-team-box -n team
   ```

   Your computer builds and runs the virtual machine, and Ringleader keeps its record.

<div class="callout callout-warning">
  <p class="callout-title">The namespace can read the spec</p>
  <div class="callout-body">
    The first time you do this in a namespace, <code>rl</code> prints a notice. Everyone who can read that
namespace can read the workstation&rsquo;s spec, including its files, environment, scripts and
dotfiles. <code>rl tui</code> shows the same notice in a dialog that stays open until you dismiss it. Keep
secrets in a Secret, not in the spec.
  </div>
</div>


To confirm it works, go to
[Check that a workstation is ready](#check-that-a-workstation-is-ready). If that is all you
need, you are done. To set what the workstation reaches on your computer, go
to [Set a workstation's host access](https://docs-stg.ringleader.dev/workstations/connectivity/host-access-loopback/#set-a-workstations-host-access).

## Check that a workstation is ready

To find out whether a workstation is ready, check its `Available` condition. `Available` is
`True` when the workstation is `Running` and fully configured. In your cloud, when an
[Edge](https://docs-stg.ringleader.dev/reference/resources/edge/) serves the workstation, `Available` also waits
until the Edge holds the keys the workstation needs.

The command line, the terminal UI and the Ringleader application all show `Available` as
the workstation's status. To wait for it from a script, run this, with the namespace the workstation is in:

```bash
rl workstation wait my-local-box --for condition=Available=True --timeout 10m -n local
```

A workstation can be `Available` while another condition reports a problem, because
`Available` counts only some conditions.
[Conditions and their reasons](https://docs-stg.ringleader.dev/reference/resources/workstation/#conditions-and-their-reasons)
lists which ones.

## Copy a node-bound workstation

To run your own copy of a teammate's node-bound workstation, copy it with
[`--node self`](https://docs-stg.ringleader.dev/reference/cli/commands/resource-verbs/#rl-kind-copy-name-new-name) on the computer that
should run the copy:

```bash
rl workstation copy my-team-box my-team-copy -n team --node self
```

Outside `local`, the copy is bound to this computer, or `rl` refuses it for a reason in
[New workstation refused](https://docs-stg.ringleader.dev/troubleshooting/#new-workstation-refused).
In `local`, the copy is stored on this computer alone. The copy takes none of the source's host
access. Without `--node self`, a copy that Ringleader would store stays bound to the source's
computer, and only that computer can create it. Anywhere else, `rl` refuses the copy and names
the flag.

## Delete a local workstation

To delete a workstation that is stored on your computer alone, run:

```bash
rl workstation delete my-local-box -n local
```

`rl` asks you to confirm, and then deletes the virtual machine and its disk. To delete it from
the application or wait until it is gone, see
[Delete a workstation](https://docs-stg.ringleader.dev/workstations/lifecycle/deletion-deadlines/#delete-a-workstation).

## Delete a node-bound workstation

To delete a node-bound workstation, run the same command in its namespace:

```bash
rl workstation delete my-team-box -n team
```

What happens to the virtual machine depends on who deletes the workstation. When its owner
deletes it, the workstation stays in `Terminating` until the computer that runs it deletes the
virtual machine. [Node-bound workstation deletion](https://docs-stg.ringleader.dev/workstations/lifecycle/deletion-deadlines/#node-bound-workstation-deletion)
describes both cases, and what to do when that computer isn't active.

## Next steps

- [Build a workstation](https://docs-stg.ringleader.dev/quickstart/workstation/) builds your first
  workstation on your computer.
- [Deletion and delete deadlines](https://docs-stg.ringleader.dev/workstations/lifecycle/deletion-deadlines/)
  describes what a deletion removes, including a node-bound workstation's.
- [Orphaned workstations and recovery](https://docs-stg.ringleader.dev/workstations/lifecycle/orphaned-workstations-recovery/)
  covers a virtual machine your computer keeps after its record is gone.
- [Host access and loopback reach](https://docs-stg.ringleader.dev/workstations/connectivity/host-access-loopback/)
  covers what a node-bound workstation reaches on your computer.
- [Provider settings](https://docs-stg.ringleader.dev/workstations/configuration/provider-settings/)
  covers how a workstation file names its provider and image, and what an unsupported image does.
- [Configuration layers](https://docs-stg.ringleader.dev/workstations/configuration/configuration-layers/)
  explains how layers attach to a workstation and which one wins.
- [Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/) lists every field, phase and
  condition.
- [Provider images and keys](https://docs-stg.ringleader.dev/reference/providers/images-keys/) lists each provider's images and
  `providerConfig` keys.

