Overview
Templates define the base environment for sandboxes:- Operating system (Ubuntu, Debian, Alpine)
- Runtimes (Node.js, Python, Go, Rust)
- Pre-installed packages
- Environment variables
System Templates
We provide pre-built templates for common use cases:| Template | OS | Runtimes | Packages | Size |
|---|---|---|---|---|
nodejs-20 | Ubuntu 22.04 | Node 20, Bun | npm, pnpm, tsx | 450MB |
python-ml | Ubuntu 22.04 | Python 3.12 | PyTorch, NumPy, Pandas | 2.1GB |
full-stack | Ubuntu 22.04 | Node 20, Python 3.12 | PostgreSQL, Redis | 1.2GB |
go-1.22 | Ubuntu 22.04 | Go 1.22 | Common Go tools | 380MB |
rust-1.75 | Alpine 3.19 | Rust 1.75 | Cargo | 520MB |
Desktop Templates
For Computer Use (GUI interaction), use a desktop-enabled template:| Template | Description | Size |
|---|---|---|
ubuntu-desktop | Ubuntu 24.04 + XFCE, Chrome, Firefox | 2.8GB |
desktop-dev | Desktop + VS Code, Node.js, Python | 3.5GB |
desktop-browser | Minimal desktop with Chrome only | 1.9GB |
Template Builder UI
Create templates visually in the dashboard:- Select base OS — Ubuntu, Debian, or Alpine
- Add runtimes — Node.js, Python, Go, Rust with version selection
- Install packages — Search and add apt, npm, pip packages
- Preview Dockerfile — See the generated Dockerfile before building
- Validate — Check for conflicts and estimate image size
Template Builder
Open the template builder in your dashboard
Configuration File
Define custom templates in yourtemplates/ directory with a Dockerfile:
templates/my-fullstack/Dockerfile
agents/my-agent.ts
Desktop Template
For Computer Use, use a desktop-enabled base image:templates/my-desktop/Dockerfile
Desktop templates are larger and take longer to boot. Only enable if you need GUI interaction.
Deploying
Build and deploy with a single command:Using SDK to Create Templates
You can also create templates programmatically via the SDK:Auto-Deploy from Git
Connect your repo to auto-deploy on push:CLI Commands
Template Marketplace
Share templates publicly:Using Templates
Once a template is ready, use it for sandboxes:Best Practices
Keep templates small
Keep templates small
Smaller templates = faster startup. Only include what you need.
Use specific versions
Use specific versions
Pin package versions for reproducibility.
node@20 not node@latest.Validate before building
Validate before building
Use
rt.templates.validate() to catch issues before waiting for a build.Reuse system templates when possible
Reuse system templates when possible
Our system templates are optimized. Only create custom if needed.