Overview
[ E2B DOCS ]

Every agent gets a machine

You ship the agent. E2B boots the isolated Linux machine it works on — in our cloud or yours — and hands you the controls.

Boot a machine#

One call gives you a fresh VM with a filesystem, a shell and the network rules you choose. Pick your interface — the machine is the same.

import { Sandbox } from 'e2b'
 
const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo "Hello from E2B!"')
console.log(result.stdout) // Hello from E2B!
from e2b import Sandbox
 
with Sandbox.create() as sandbox:
    result = sandbox.commands.run('echo "Hello from E2B!"')
    print(result.stdout)  # Hello from E2B!
# Start a sandbox with Claude Code preinstalled
npm i -g @e2b/cli
e2b sbx create claude
curl -X POST https://api.e2b.app/sandboxes \
  -H "X-API-Key: $E2B_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"templateID": "base", "timeout": 300}'
100K+
teams on E2B
94
of the Fortune 100 signed up
1B+
sandboxes started
10M+
monthly SDK downloads

The whole lifecycle in four calls#

1
Create

Sandbox.create() boots a machine from a template — base by default, or your own. Pass timeoutMs / timeout to decide how long it lives. → Lifecycle

2
Run

sandbox.commands.run() executes shell commands, streams stdout, or keeps a process alive in the background. Need an interactive shell? Open a PTY.

3
Pause

sandbox.pause() freezes the filesystem and memory. Paused machines are kept indefinitely; Sandbox.connect(id) brings one back exactly as it was. → Pause & resume

4
Fork

sandbox.fork({ count: 5 }) boots five copies of a running machine — files, processes, loaded variables — in one call. Up to 100 at once. → Fork

What else the machine can do#

StateSnapshots

Checkpoint a live sandbox and spawn any number of new ones from that exact moment, while the original keeps running.

SecurityEgress rules

Allow-list domains, CIDRs and wildcards, inject headers per host, change rules on a running machine.

BuildCustom templates

Define the image in code; whatever your start command launched is already running when a sandbox boots.

ToolsMCP gateway

200+ tools from the Docker MCP Catalog behind one authenticated endpoint inside every sandbox.

DesktopComputer use

Ubuntu desktop with VNC streaming: screenshot, click, type, scroll — the loop a vision model needs.

NetworkPublic URLs

Every port gets an HTTPS address, so an agent can ship a live preview.

EnterpriseBring your own cloud

Sandboxes inside your AWS or GCP VPC; templates, snapshots and traffic never leave it.

Agents that already run on E2B#

Pre-built templates and guides for the agents your users bring. See all 30+ integrations →

Shipped recently#

September 14, 2026 — automatic 429 retries

The SDKs now retry rate-limited calls up to three times, honouring the server's delay. HTTP 503 raises ServiceBusyError, and E2B Embed brings self-hosted deployments via Docker Compose, Terraform or Kubernetes.

September 7, 2026 — Workspaces

Workspaces group your E2B projects under one name in the console. Also: Cursor self-hosted agents, HTTPS backend ports on sandbox creation, higher stream concurrency in the Python SDK.

August 31, 2026 — wildcard transform rules

Network transform rules accept a leading wildcard domain. The sandbox git module is deprecated in favour of running git through commands.run — see Git in a sandbox.

August 24, 2026 — bring your own proxy

Route sandbox egress through your own SOCKS5 proxy, sort and filter sandbox lists, and manage snapshots from the CLI.

Full changelog →

$100 in credits on every new account
Give your agent a machine today

Sign up, copy your API key, boot a sandbox in the next five minutes.