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

# E2B

> Provision RemoteMux directly into E2B sandboxes with backend=e2b.

`backend=e2b` keeps the RemoteMux workspace model, but runs it on top of E2B
sandboxes instead of a VM you own.

## At A Glance

<CardGroup cols={3}>
  <Card title="Ownership">
    Your team owns the E2B account, API key, and sandbox templates.
  </Card>

  <Card title="Attach">
    Interactive access and remote commands use the E2B PTY API.
  </Card>

  <Card title="Bootstrap">
    `rmux workspace new main` creates the initial workspace for the environment.
  </Card>
</CardGroup>

## You Need

* an E2B API key
* an E2B template, or the default `base` template
* a template that supports bootstrap package installs through `apt-get` or `dnf`

`e2b.timeoutMs` defaults to `3600000`. In the current implementation, RemoteMux
creates sandboxes with pause-on-timeout behavior and auto-resume enabled.

## Configure

The shortest setup path is:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cd /path/to/project
rmux configure \
  --backend e2b \
  --e2b-api-key e2b_xxx
```

You can also set the template and timeout explicitly:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
rmux configure \
  --backend e2b \
  --e2b-api-key e2b_xxx \
  --e2b-template base \
  --e2b-timeout-ms 3600000 \
  --e2b-domain e2b.dev
```

`e2b.apiKey` is required. `e2b.template` defaults to `base`, and `e2b.domain` is only needed when you want to override the default E2B API domain.

## Validate

There is no dedicated `rmux e2b-check` command in the current implementation.

Use:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
rmux configure --show
```

That shows the resolved backend, template, timeout, and a masked E2B API key for the current directory.

## Create And Work

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
rmux env new
rmux workspace new main
rmux workspace attach
rmux workspace new agent-a
rmux workspace run -w agent-a bun test
```

## How E2B Behaves

| Aspect       | Behavior                                                                     |
| ------------ | ---------------------------------------------------------------------------- |
| Provisioning | Creates one E2B sandbox per environment.                                     |
| Attach       | Uses the E2B PTY API.                                                        |
| Bootstrap    | `rmux workspace new main` creates the initial workspace for the environment. |
| Editors      | Not supported in the current implementation.                                 |

Like the other backends, the remote project root is `/workspace`, `main` is
the default workspace, and named workspaces use git worktrees for git repos and
copied folders for non-git projects.
