---
title: Templates · Sandboxes docs
description: Ready-made sandboxes for data, browsing, computer use, coding agents, JavaScript, Go, Rust and Postgres, plus your own templates on top.
url: https://www.quietrobot.ai/docs/sandboxes/templates
---

# Templates

Ready-made sandboxes for data, browsing, computer use, coding agents, JavaScript, Go, Rust and Postgres, plus your own templates on top.

> [!NOTE]
> Sandboxes is in early access. It is free to try, some parts are still in testing, and details may change.

A template is what a sandbox starts with. Pick one by name when you create a sandbox, and it starts from a warm, ready machine with its tools already installed.

```ts
const sbx = await qr.create({ template: "browser" });
```

```python
sbx = qr.create(template="code-interpreter")
```

```bash
qr create --template desktop
```

## Our templates

| `template` | What's in it | Default size |
|---|---|---|
| `base` | Debian with Python 3, pip and venv, Node.js and npm, git, curl, jq and unzip. The default. | 1 vCPU, 2 GB |
| `minimal` | Debian with only what the sandbox needs to run. The smallest and quickest to start. | 1 vCPU, 2 GB |
| `code-interpreter` | Python with pandas, NumPy, Matplotlib, seaborn and openpyxl, plus a Jupyter server and kernel. For agents that analyze data and draw charts. | 1 vCPU, 2 GB |
| `browser` | Playwright for Python and Node.js, with Chromium already installed. For scraping, testing and agents that browse the web. | 1 vCPU, 2 GB |
| `desktop` | A lightweight Linux desktop with Chromium, which you or your agent can see and control over VNC in a browser. For computer-use agents. | 2 vCPU, 2 GB |
| `coding-agent` | git, the GitHub CLI, ripgrep, fd, build tools, tmux and uv, with one command to add Claude Code, Codex, Gemini CLI or Aider. | 1 vCPU, 2 GB |
| `fullstack-js` | Node.js LTS, Bun and pnpm, with the npm cache already holding React, Next.js, Vite, Express, Tailwind and TypeScript. | 1 vCPU, 2 GB |
| `go` | The current Go release. | 1 vCPU, 2 GB |
| `rust` | Stable Rust with cargo, clippy and rustfmt, plus the C tools crates need. | 1 vCPU, 2 GB |
| `postgres` | PostgreSQL 17 with pgvector, ready to start with one command. | 1 vCPU, 2 GB |

`GET /api/v1/templates` lists them under `official`, with each one's default size. Send `cpus` and `memoryMb` to pick another [size](https://www.quietrobot.ai/docs/sandboxes/sizes-and-regions). Every image is pinned, and `GET /api/v1/sandboxes/{id}/image` lists every package and tool version in it.

Nothing runs on its own when a sandbox starts. Templates with a long-running part (Jupyter, the desktop, Postgres) start it with a helper command. Send it as the first command in the create request with `run`, so it's ready when the call returns.

## Code interpreter

```ts
const sbx = await qr.create({ template: "code-interpreter", egress: { mode: "deny" } });
await sbx.files.write("sales.csv", csv);
const r = await sbx.exec(`python3 -c "
import pandas as pd
df = pd.read_csv('sales.csv')
df.groupby('month').total.sum().plot(kind='bar').figure.savefig('chart.png')
print(df.describe())"`);
const png = await sbx.files.read("chart.png");
```

Charts render to files (`MPLBACKEND` is `Agg`). For a notebook in your browser, run `qr-jupyter start`, which prints a token, then expose port `8888` as a private [preview link](https://www.quietrobot.ai/docs/sandboxes/network) and add `?token=<token>`. `pip install` works without a virtual environment.

## Browser

```python
sbx = qr.create(template="browser", egress={"mode": "open"})
sbx.exec("""python3 -c "
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    page = p.chromium.launch().new_page()
    page.goto('https://example.com')
    print(page.title())"
""")
```

Playwright works from Python and from Node.js (`require("playwright")`). The browser can only reach the sites your [outbound rules](https://www.quietrobot.ai/docs/sandboxes/network) allow.

### Watch it live

While your agent drives the browser, you can watch it. On the sandbox's page in the dashboard, press **Watch live**: it opens a private link that shows each page the browser has open, as it happens. Press **Take control** to click and type yourself, for example to get past a sign-in, then hand it back.

From code, run `qr-live start` in the sandbox and share port `9300` as a private [preview link](https://www.quietrobot.ai/docs/sandboxes/commands-and-files#preview-links). The view works with any Chromium the agent starts, through Playwright or not, in the browser and desktop templates and templates built on them. Set `QR_LIVE=0` in `env` to turn it off for a sandbox. Browser sandboxes started before this was added need to be started again to get it.

## Desktop

A full screen your agent can look at and click on. Start it, then watch or take over in your own browser.

```bash
curl -s "https://api.quietrobot.ai/api/v1/sandboxes" -H "Authorization: Bearer $QR_API_KEY" -H "Content-Type: application/json" \
  -d '{"template":"desktop","run":{"cmd":"qr-desktop start"}}'

# See it in a browser: expose port 6080 as a private preview link
curl -s -X PUT "https://api.quietrobot.ai/api/v1/sandboxes/$SBX/ports" -H "Authorization: Bearer $QR_API_KEY" -H "Content-Type: application/json" \
  -d '{"ports":[{"port":6080,"access":"private"}]}'
```

Your agent works the screen with commands:

| Command | What it does |
|---|---|
| `qr-desktop screenshot` | Saves a PNG of the screen to `~/screenshot.png`. Read it with the files API. |
| `xdotool mousemove 400 300 click 1` | Moves the mouse and clicks. |
| `xdotool type "hello"`, `xdotool key ctrl+l` | Types and presses keys. |
| `qr-desktop open https://example.com` | Opens Chromium on the desktop. |
| `qr-desktop stop` | Stops the desktop. |

The screen is 1280 by 800; set `QR_DESKTOP_SIZE` (for example `1920x1080`) in `env` for another size. The preview link's token keeps the page private; set `QR_VNC_PASSWORD` to also ask for a password.

## Coding agent

```ts
const sbx = await qr.create({
  template: "coding-agent",
  secrets: ["ANTHROPIC_API_KEY"],
  egress: { mode: "allowlist", allow: ["registry.npmjs.org", "api.anthropic.com", "github.com"] },
});
await sbx.exec("qr-agents install claude");
await sbx.exec("git clone https://github.com/you/app && cd app && claude -p 'Fix the failing tests'");
```

`qr-agents install` adds `claude` (Claude Code), `codex`, `gemini` or `aider` in seconds, from npm or PyPI, so allow `registry.npmjs.org` (or `pypi.org` and `files.pythonhosted.org` for Aider) and the agent's own API. Pass the agent's key as a [secret](https://www.quietrobot.ai/docs/sandboxes/secrets) so it never enters the sandbox. Every command the agent runs goes through your [approval rules](https://www.quietrobot.ai/docs/sandboxes/approvals) and lands in the [audit log](https://www.quietrobot.ai/docs/sandboxes/audit).

## Full-stack JS

`node`, `npm`, `bun` and `pnpm` are ready. `npm install` of React, Next.js, Vite, Express, Tailwind, TypeScript and Zod comes from the warm cache, so it's quick and works with outbound traffic blocked (`npm install --offline`). Run a dev server and expose its port for a preview link.

## Go and Rust

`go` and `cargo` are on the path. Rust's toolchain belongs to the sandbox user, so `cargo install` and `rustup component add` work without `sudo`. Fetching modules and crates needs `proxy.golang.org` or `crates.io` and `static.crates.io` allowed.

## Postgres

```bash
qr-postgres start
psql -c "create table notes (id serial, body text, embedding vector(3))"
```

PostgreSQL 17 with the pgvector extension, on `localhost:5432`. `PGHOST`, `PGUSER`, `PGDATABASE` and `DATABASE_URL` are set in every command, so `psql` and most libraries connect with no arguments. The data lives in the home folder, so it's kept through a pause and in snapshots.

## Your own templates

Build a template from a Dockerfile on top of any of ours, then start sandboxes from it by name. Builds run in their own microVM.

```bash
curl -s -X POST "https://api.quietrobot.ai/api/v1/templates" \
  -H "Authorization: Bearer $QR_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"scraper","dockerfile":"FROM quietrobot/browser\nRUN pip install beautifulsoup4"}'
```

* The last stage must start `FROM quietrobot/<template>`, for example `quietrobot/base`, `quietrobot/minimal` or `quietrobot/browser`. Earlier stages can use any public image. Your template gets the environment of the one it's built on.
* There's no build context: fetch files with `RUN` or `ADD <url>`, or `COPY --from` another stage. `ENV` values reach every command; `CMD`, `ENTRYPOINT`, `VOLUME` and `HEALTHCHECK` aren't used.
* The call returns `202` at once. Poll `GET /api/v1/templates/{id}` until `status` is `ready`; `GET /api/v1/template-builds/{id}` has the build log.
* Then `create({ template: "scraper" })`. A rebuild keeps serving the old image until the new one is ready, and `upToDate: false` tells you the template it's built on has updates to pick up.
* Your plan limits how many templates you keep, builds a day, build time and image size. Build time is billed at Standard rates.
