selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

e2b logo

Self-host e2b

@e2b/python-sdk@2.63.0

Isolated sandboxes for AI agents to run code safely

ReleaseOpen SourceApache-2.0
Docker ComposeCompose file & guide
docker compose up -d --wait
Updatedlast week
LanguagePython
Setup difficultyModerate
Stars
14 833
Ports
3000 (api — the REST API the SDK calls), 3001 (dashboard — the web dashboard, for a browser), 3002 (client-proxy — sandbox traffic (header routing))
Requires
ClickHouse, Firecracker, PostgreSQL, Redis, Vector
Docker
us-docker.pkg.dev/e2b-artifacts/api/api

What is e2b?

E2B is open-source infrastructure for running AI-generated code in secure, isolated Linux environments: agents get on-demand VMs where they can execute code, process data and use tools without touching your production systems. You drive it with JavaScript/TypeScript or Python SDKs — create a sandbox, run shell commands, evaluate code through the Code Interpreter SDK, or take over a virtual desktop with mouse, keyboard and screenshot APIs. Sandboxes can be paused and resumed (filesystem and memory both persist), snapshotted and forked, and are built from custom templates you define. The managed E2B Cloud is the hosted option, but E2B Embed runs the entire stack — control-plane API, dashboard, orchestrator and storage — on one machine inside your own environment, keeping templates, logs and data local; it is installed with Docker Compose, Terraform (GCP, AWS, Azure) or Kubernetes and needs no E2B account or license key. Embed requires a Linux host with hardware virtualization, speaks plain HTTP with no built-in TLS, and is deliberately a single node; Bring Your Own Cloud and a private-cloud edition (in development) are commercial options for bigger deployments. Sandboxes are CPU-only, with no GPU support.

e2b alternatives

Should you self-host e2b?

e2b scores 76/100 on selfhost.directory (how scoring works) and ranks #19 of 209 in AI Agents. It has 14 833 GitHub stars, +572 in the last 30 days.

It shipped 85 stable releases in the past year. The latest, @e2b/python-sdk@2.63.0, came out on 4 November 2026. New versions land roughly every 1 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is Apache-2.0-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is Orca (91/100, 123 765 stars). It scores higher overall, so compare the two before you pick. See e2b vs Orca side by side.

Features

  • CLI
  • Code interpreter execution
  • Computer use / virtual desktop
  • Custom sandbox templates
  • GPU AccelerationBy design (FAQ)
  • Isolated code-execution sandboxes
  • OpenTelemetry export
  • REST API
  • Sandbox lifecycle webhooks
  • Sandbox metrics monitoring
  • Sandbox pause and resume (persistence)
  • Sandbox snapshots and forking
  • SSH access to sandboxes
  • Web Dashboard

e2b README

E2B Logo E2B Logo

What is E2B?

E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.

How to install e2b

Install e2b with Docker Compose

Environment variables
E2B_API_KEY, TEAM_API_KEY, ADMIN_TOKEN, SANDBOX_ACCESS_TOKEN_HASH_SEED, E2B_DASHBOARD_HOST, E2B_OTEL_COLLECTOR_GRPC_ENDPOINT
mkdir e2b && cd e2b
curl -fsSL --remote-name-all "https://raw.githubusercontent.com/e2b-dev/runtime/main/embed/compose/{compose.yaml,.env}"
docker compose up -d --wait

E2B Embed on a Linux host you own; images and versions are pinned in the .env that ships beside compose.yaml.

How to configure e2b

  • E2B_API_IMAGEus-docker.pkg.dev/e2b-artifacts/api/api:v0.14.202610051633-d1cd3db3890Platform pins. Embed is released at the platform version once that release is tagged, and each Embed release moves these lines to it: the trailing marker is what the release tooling rewrites. Everything without a marker is pinned by hand.
  • E2B_DB_MIGRATOR_IMAGEus-docker.pkg.dev/e2b-artifacts/api/db-migrator:v0.14.202610051633-d1cd3db3890
  • E2B_CLIENT_PROXY_IMAGEus-docker.pkg.dev/e2b-artifacts/client-proxy/client-proxy:v0.3.202610051633-d1cd3db3890
  • E2B_CLICKHOUSE_MIGRATOR_IMAGEus-docker.pkg.dev/e2b-artifacts/clickhouse-migrator/clickhouse-migrator:v0.4.202610051633-d1cd3db3890
  • E2B_DASHBOARD_API_IMAGEus-docker.pkg.dev/e2b-artifacts/dashboard-api/dashboard-api:v0.7.202610051633-d1cd3db3890dashboard-api is a platform image and moves with the release like the api it serves; it must come from the same source commit as the api and db-migrator.

e2b releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

Why does iptables fail with 'xt_owner module missing' in a sandbox?

The sandbox kernel does not ship the xt_owner module, so --uid-owner/--gid-owner rules fail; use nftables instead.

Do you publish egress IP ranges (CIDRs)?

No — sandbox egress uses ephemeral rotating IPs, so allowlist the cloud provider's ranges or route through your own proxy.

How do I migrate to a different region?

Each region is a separate deployment: contact support for a project in the new region, use its API key and domain, and rebuild templates there.

Can I run sandboxes in the EU?

Yes, a shared EU cluster is available for Pro tier and above; contact support for access.

What are the limitations of the Volumes beta?

File locking can hang, metadata caching is disabled, permission bits are not enforced between users, mounts are fixed at creation, and snapshots/read-only mounts are unsupported.

Why does my template build fail with a Docker push authentication error?

Add E2B's local registry proxy (host.docker.internal:49984, or localhost:49984 on Linux) to Docker's insecure-registries and restart Docker.

Why does pip install fail when building a template?

Large packages exhaust the build environment's RAM cache and /tmp; set TMPDIR to a disk path with --no-cache-dir, or install CPU-only builds.

Can I make a template public so other projects can use it?

Yes — publish from the console's Templates tab or with the CLI, and other projects can create sandboxes from it by project-slug/template-name.

Is there a limit on how many templates I can create?

No total template limit; only concurrent builds are capped (20 on Hobby and Pro, custom on Enterprise).

What limits apply to my template builds?

Plan limits such as concurrent builds can be raised by upgrading or contacting support, while build timeouts are fixed for everyone.

Does E2B support GPUs?

No, sandboxes are CPU-only and sized by vCPU and RAM, with no GPU option anywhere; BYOC does not change this.

Do paused sandboxes count toward the concurrency limit?

No — only running sandboxes count toward concurrency and are billed, and there is no time limit on how long a sandbox stays paused.

How long does a sandbox live?

Continuous runtime is capped by plan (1 hour Hobby, 24 hours Pro, custom Enterprise) and resets on pause/resume; paused sandboxes are kept indefinitely.

How do I increase my concurrency limit?

Raise the concurrent sandbox limit with self-serve add-ons in the console's billing tab, or contact sales for higher Enterprise limits.

How do I calculate the price of a sandbox?

Billing is per second only while a sandbox is running, based on the vCPU and RAM allocated to it; paused and killed sandboxes are not billed.

More in AI Agents

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…