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

# Templates

> The images sandboxes start from.

A template is the image a sandbox boots from, plus the size it runs at when you do not choose one (any of the [sandbox sizes](/docs/concepts/sizes.md) at or above its minimum can be chosen instead). Every template runs Ubuntu 24.04 with E2B's `envd` 0.5.13 on port 49983, the user `user` (uid 1000) and `tini`, and starts nothing else at boot unless it says so. That keeps idle sandboxes small, which is what keeps them cheap.

| Template | Adds | vCPU | Memory | Disk |
| - | - | - | - | - |
| `base` (default) | git, less, unzip, xz-utils, OpenSSH client and an on-demand SSH server | 2 | 1 GiB | 1 GiB |
| `python` | `base` + Python 3.12, build-essential, uv, a venv at `/opt/venv` with numpy, pandas, requests, httpx | 2 | 2 GiB | 2 GiB |
| `node` | `base` + Node.js 24 LTS, npm, pnpm (`npm i -g` goes to `~/.npm-global`) | 2 | 2 GiB | 2 GiB |
| `code-interpreter` | `python` + Jupyter Server and E2B's code-interpreter server on port 49999 | 2 | 2 GiB | 2 GiB |
| `desktop` | Xvfb, XFCE, xdotool, scrot, x11vnc, noVNC on 6080, Google Chrome. Nothing runs until you start the desktop | 2 | 4 GiB | 4 GiB |
| `agent-desktop` | `desktop` + `python` + Node 24, Bun, Rust, Java 21, gh, Docker CLI (no daemon), ripgrep, jq and seven coding-agent CLIs: Claude Code, Codex, OpenCode, pi, Kimi Code, Mistral Vibe, Cursor Agent | 2 | 6 GiB | 8 GiB |

Pick one by name:

```python template.py
from anona_compute import Sandbox

sbx = Sandbox.create("python")
print(sbx.get_info().template_id)
sbx.kill()
```

```typescript template.ts
import { Sandbox } from "@anona-labs/compute-sdk";

const sbx = await Sandbox.create("python");
console.log((await sbx.getInfo()).templateId);
await sbx.kill();
```

```bash template.sh
anona-compute run -t python -- 'echo running in a python sandbox'
anona-compute config set default_template python   # the CLI's default for create and run
```

## code-interpreter

The `code-interpreter` template runs E2B's own code-interpreter server (a Python kernel behind Jupyter) on port 49999, the server the `e2b-code-interpreter` SDK talks to. Create it with `Sandbox.create(template="code-interpreter")` from that SDK. Running the `e2b-code-interpreter` SDK end to end against Anona is not part of the published compatibility checks yet.

## agent-desktop

> [!NOTE]
>
> A `coding-agent` template (the same toolchain without the desktop) is built but not offered yet; creating it returns `404 template not found`. Use `agent-desktop`.

Each agent CLI in `agent-desktop` has the `anona-computer-use` MCP server registered in its own config, and an `anona` skill installed. The computer-use server is a placeholder today: its `screenshot`, `mouse_move`, `click`, `type_text` and `key` tools call `scrot` and `xdotool` and need a running X display. The agents need their own provider credentials; pass them as environment variables at create time.

## Build your own

Build a template from a Dockerfile with the CLI, or from the E2B SDK's `Template.build`. The gateway builds the image with BuildKit in an isolated builder, adds the Anona runtime layer (`envd`, the entrypoint and the guest agent), pushes it and registers it; sandboxes then start from it by name.

```bash template_build.sh
cat > Dockerfile <<'EOF'
FROM python:3.12-slim
RUN pip install --no-cache-dir polars
EOF

anona-compute template build --name my-env          # builds the current directory, streams the log
anona-compute template list
anona-compute template info my-env
anona-compute template logs my-env
anona-compute create -t my-env                      # a sandbox from it
anona-compute template delete my-env --yes
```

```python template_build.py
from e2b import Template  # the stock SDK's build flow works unchanged

template = (
    Template()
    .from_image("python:3.12-slim")
    .run_cmd("pip install --no-cache-dir polars")
)
Template.build(template, alias="my-env", cpu_count=2, memory_mb=2048)
```

What the builder enforces:

* Every `FROM` is pinned by digest at build time, so a rebuild gets the same base.
* `EXPOSE 49983` (envd) is refused; the Anona runtime owns that port.
* The build runs with no credentials, no privileges and its own CPU, memory, PID and time limits, on a network whose only way out is a proxy that applies the same [platform floor](/docs/concepts/networking.md) as a sandbox.
* The image's `CMD`/`ENTRYPOINT` runs at sandbox start only when the last stage declares one, or with `--start-cmd`. It is the sandbox's main process, so it must keep running: a start command that exits stops the sandbox, and the build fails at registration saying so. Its exit code and output are not reported; build without the start command and run it in a sandbox to see them.
* `.dockerignore` in the build context is honoured.

Defaults and limits: 2 vCPU and 2 GiB per sandbox unless `--cpu`/`--memory` say otherwise (at most 8 vCPU and 16 GiB), a 1 GiB writable disk unless `--disk` says otherwise (in MiB, up to your plan's per-sandbox disk limit and at most 80 GB, XL's disk; through the E2B API, `minFreeDiskMb` asks for that much free space instead), 2 builds in progress at a time (the shared builder runs them one after another, so a second one waits in the queue), and a build context up to 1 GiB.

Template size limits:

* **One template image** is at most 10 GiB uncompressed, on every plan. The size is measured after the build, before the image is stored, so an image over it fails with its size in the reason and nothing is kept. A multi-stage build, and removing package caches in the same step that creates them, are the usual ways to slim one.
* **Templates per organization** and **template storage** are set by your plan:

| Plan | Templates | Template storage |
| - | - | - |
| Free | 2 | 10 GiB |
| Starter | 10 | 50 GiB |
| Pro | 25 | 150 GiB |
| Scale | 100 | 500 GiB |

Template storage is the sum of each template's current build image. The build before it is kept so you can roll back, and does not count, so a rebuild counts only the difference it makes. Built-in templates never count. A new template is refused once you reach the template count or template storage is full (`403` `plan_limit_exceeded`); rebuilding an existing one never is. `anona-compute template list` shows each template's size and your usage against both limits, as does the Templates page of the console. Deleting a template leaves sandboxes that already run from it alone; new creates stop resolving the name.

A failed rebuild does not take a template down: it stays `ready` and keeps starting sandboxes from its last ready build, and `anona-compute template list` adds "(last build failed)" while `template info` names the failed build and its reason. The failed build shows as `error` in the template's build list.

The dashboard's **Templates** page lists templates, build status and build logs, and deletes them.

> [!WARNING]
>
> Custom template builds are in preview.

> [!NOTE]
>
> A template you build has its vCPU, memory and disk as its minimum requirements: a sandbox from it can be created at any [sandbox size](/docs/concepts/sizes.md) (Small, Medium, Large or XL) that meets all three, and runs at the template's own size when no size is given. A built-in template's minimum size is set for it instead (see [which templates run on which size](/docs/concepts/sizes.md#which-templates-run-on-which-size)).


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