> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Compute

> Add the Linux servers sandboxes run on: connect over SSH, confirm the server, bootstrap it, and keep it healthy.

A compute is a place sandboxes run. Today that is a Linux server with Docker that BOW reaches over SSH. Admins with **Manage Sandboxes** add computes under **Settings → Sandbox → Compute**.

![The Compute tab with two servers, their status, resources and the Test button](https://mintcdn.com/bagofwords/jdi37jk3RbRDCvpb/images/sandboxes/compute-tab.png?fit=max\&auto=format\&n=jdi37jk3RbRDCvpb\&q=85\&s=ae4442f6e2c4b5af432857cfbfebe4e6)

## What the server needs

* **Linux with Docker** installed and running.
* **An SSH login** as `root`, or as a user with passwordless `sudo`. BOW then runs every command through `sudo -n`.
* **Two ports reachable from BOW**: the SSH port (22 by default) and one port for sandbox traffic (8443 by default). The server does not need to reach BOW.
* **gVisor, optional.** When `runsc` is installed and registered with Docker, sandboxes run under it and the compute shows **Strong isolation**. Without it the compute shows **Standard isolation**: sandboxes are ordinary containers that share the server's kernel. BOW detects gVisor; it never installs it or edits Docker's configuration.

Use a server dedicated to sandboxes. BOW runs commands as root on it, and the code agents run there is not code you reviewed.

## Add a compute

**1. Fill in the form**

Select **Add compute**, choose **Linux server (Docker over SSH)**, and enter a name, the server's **Address**, the **SSH port** and the **SSH user**.

For the key, either paste an **SSH private key**, or leave it empty: BOW then generates a key pair and shows you the public key to add to the SSH user's `authorized_keys` on the server. You can also enter a **One-time password**; BOW logs in with it once to install its public key and never stores it.

**2. Test the connection and confirm the server**

Select **Test**. The first time, BOW shows the fingerprint of the SSH host key the server presented. Compare it with the server's own, then select **This is my server, trust it**. Nothing is sent to the server before you do.

To read the fingerprint on the server:

```bash theme={null}
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
```

You can also paste the fingerprint into **SSH host key fingerprint** when you add the compute, and skip the confirmation.

**3. Bootstrap**

Select **Bootstrap**. BOW prepares the server step by step and shows each step as it finishes: it checks Docker, detects gVisor, creates the sandbox network, places its sandbox daemon, pulls its images, starts a router and an egress proxy, applies firewall rules, and verifies the result with a test sandbox. A failed step says which one and why. Bootstrap is safe to run again.

**4. Enable**

Turn on the **Enabled** switch. A compute can be enabled only after its bootstrap has succeeded. Sandboxes are placed only on enabled computes.

![The Add compute form for a Linux server](https://mintcdn.com/bagofwords/jdi37jk3RbRDCvpb/images/sandboxes/compute-add.png?fit=max\&auto=format\&n=jdi37jk3RbRDCvpb\&q=85\&s=7a5192b6f668a98afd141d1d41378614)

## Test and repair

Once a compute is bootstrapped, its row has one button: **Test**. It does two things in the same dialog:

1. **Checks**: the SSH host key, the login, Docker, gVisor, and whether BOW's own containers are running.
2. **Repair**: runs the bootstrap steps again. Each step skips what is in place and puts back what is missing or out of date.

Use it after a server reboot, after a BOW upgrade, or whenever a compute shows a problem. The repair runs only when the checks could log in; a compute that was never bootstrapped, or cannot be reached, is only checked.

> [!WARNING]
>
> A repair that fails disables the compute, as a failed bootstrap does. Existing sandboxes stay on it; new ones are not placed there until a repair succeeds and you enable it again.

The **Bootstrap** column shows the result of the last run. Select it to see the steps again.

## Capacity

A compute is full when its resources are, not after a fixed number of sandboxes. Each sandbox counts by the limits of its environment:

* Running sandboxes hold CPU and memory.
* Every sandbox that still exists, stopped ones included, holds its disk.

The **Resources** column shows what sandboxes hold out of what the compute may give. Under **Capacity rules** in the compute's form you can change how that is counted:

| Setting | Default | Meaning |
| - | - | - |
| **CPU overcommit** | 4 | CPUs promised to sandboxes for each real CPU. Sandboxes are idle most of the time, so more than 1 is safe |
| **Memory overcommit** | 1 | 1 means the memory limits of running sandboxes must fit in the server's memory. More than 1 risks out-of-memory kills |
| **Memory kept free (MB)** | 1024 | Left for the operating system and BOW's own services |
| **Disk kept free (MB)** | 5120 | Left for images, logs and the system |
| **Maximum sandboxes** | 20 | An upper bound on sandboxes running at once, on top of the rules above |

When several computes fit, a new sandbox goes to the least loaded one. **Labels** let an environment ask for specific computes, for example `gpu` or `eu-west`.

## Volumes

A volume is a directory on the server that environments can mount in their sandboxes, by name. Use one for reference data, a shared package cache, or storage larger than a sandbox's disk. A volume does not count against a sandbox's disk limit.

Add volumes in the compute's form: a **Name** and the **Directory on the server**. The directory must already exist; you mount it there yourself, from a local disk, NFS or an object store. Which sandboxes see a volume, at what path and whether they can write to it is set on the [environment](https://docs.bow.ai/sandboxes/environments.md#volumes).

## Corporate networks

If the server reaches the internet through your own proxy, or your network re-signs HTTPS traffic, fill in the network fields of the compute's form:

| Field | When to use it |
| - | - |
| **Outbound proxy**, **Outbound proxy user name**, **Outbound proxy password** | The server reaches the internet only through your proxy |
| **Extra CA certificates** | Your network re-signs HTTPS traffic. Paste the PEM certificates sandboxes should trust |
| **Hosts sandboxes reach without the proxy** | Rarely needed; added to the sandbox's `NO_PROXY` |
| **BoW address** | Restrict the sandbox port so only BOW's address may connect to it |
| **Images are preloaded (air-gapped)** | The server cannot pull images. See below |

Run **Test** after changing them so the server picks the change up. Details are in [Network and security](https://docs.bow.ai/sandboxes/network-and-security.md#corporate-networks).

## Images

Bootstrap pulls the images BOW runs on the server, tagged with your BOW version. To use a mirror, a private registry or your own builds, set these on the BOW server:

```bash theme={null}
BOW_SANDBOX_IMAGE=registry.example.com/bow/sandbox:1.2.3            # the built-in environment's image
BOW_SANDBOX_CADDY_IMAGE=registry.example.com/bow/sandbox-caddy:1.2.3
BOW_SANDBOX_FIREWALL_IMAGE=registry.example.com/bow/sandbox-firewall:1.2.3
BOW_SANDBOX_TOOLS_IMAGE=registry.example.com/bow/sandbox-tools:1.2.3
```

For a server that cannot pull images at all, load them there with `docker load` and tick **Images are preloaded (air-gapped)**. Bootstrap then checks that each image is present instead of pulling it, and names any that is missing.

The image of each environment is separate: BOW fetches it when you save the environment or when the first sandbox needs it, so an environment image that cannot be fetched never fails a bootstrap.

## Maintenance

| Task | How |
| - | - |
| **Stop new sandboxes landing on a compute** | Turn off **Enabled**. Existing sandboxes keep working |
| **Move sandboxes off a compute** | Disable it, then select **Evacuate**. Each sandbox is snapshotted and removed there; the next run in its report recreates it on another compute from the snapshot. A sandbox that is running something, or whose snapshot fails, stays where it is and is listed |
| **Point a compute at another server** | Edit its address. BOW forgets the old server's identity and bootstrap, and disables the compute until you confirm and bootstrap the new one. Delete its sandboxes first |
| **Delete a compute** | Select the delete icon. **Also clean up the server** removes everything BOW installed on it. A compute that still has sandboxes can be deleted together with them |
| **A server already used by another BOW** | Bootstrap stops and offers **Take over**. Taking over removes the other instance's sandboxes on that server |

BOW checks every compute every few minutes. A compute that does not answer shows **Unreachable**, and no new sandbox is placed on it until it answers again.

## Related

* [Environments](https://docs.bow.ai/sandboxes/environments.md)
* [Manage sandboxes](https://docs.bow.ai/sandboxes/manage.md)
* [Network and security](https://docs.bow.ai/sandboxes/network-and-security.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.