Skip to content

Running self-hosted E2B on one local machine #504

Closed

Description

@Daanish2003

Question

What does it take to run self-hosted E2B on one local machine, specifically this owner's Windows 11 machine under WSL2 with nested virtualization, and on one cloud VM later?

Read primary sources (the E2B infra repo, its self-hosting docs, issues and discussions) for:

  • Supported install paths for one node (Compose, Terraform, other) and which of them runs locally.
  • Host requirements: KVM, kernel, RAM, disk, privileged containers, networking, DNS and TLS (the Self-hostable sandbox findings say "no TLS").
  • Known problems running it under WSL2.
  • The steps to build and register a custom template on self-hosted E2B.
  • How the SDK authenticates against it (API key, domain), and where those values come from.

Facts only, each cited. The output is the checklist the follow-up task ticket hands the owner.

Activity

  1. self-assigned this
    on Oct 17, 2026
  2. Daanish2003 commented on Oct 17, 2026

    @Daanish2003
    OwnerAuthor

    Resolution: research findings (facts only, no pick)

    Full write-up, each claim cited, ending in a 20-step draft checklist for #505: docs/research/always-on-agent/e2b-local-self-host.md

    The repo e2b-dev/infra is now e2b-dev/runtime. Its single-machine package is E2B Embed.

    Install paths

    • Docker Compose: the only local path. Two files (compose.yaml, .env) and docker compose up -d --wait. It preflights the host, prepares it, seeds a key and builds base. About 2 min on 8 vCPU / 32 GiB.
    • Terraform (GCP, AWS, Azure) makes one cloud VM. Kubernetes needs one node of a cluster.
    • From source (DEV-LOCAL.md) is for developing E2B itself and is marked "work in progress".

    Host requirements (Compose)

    • Linux x86-64 (tested) or arm64, 4 KiB pages, Ubuntu 24.04 recommended, kernel 6.8+, glibc 2.34+, cgroup v2.
    • /dev/kvm, /dev/net/tun, nbd module; iptables rsync e2fsprogs iproute2.
    • Docker Engine 27+, Compose 2.24+. Privileged, host-PID, host-network containers; the orchestrator runs on the host through nsenter -t 1.
    • 12 GiB RAM recommended (4 GiB is hugepages, about 8 full or 20 idle sandboxes). 20 GiB free disk on /.
    • Plain HTTP, no TLS, no DNS needed. SDK needs ports 3000 and 3002; dashboard 3001. Port 5008 is an unauthenticated control API; keep it private.

    WSL2

    Templates

    • Template.build(tpl, alias=..., cpu_count=..., memory_mb=...) through the same API, then Sandbox.create(alias). The build runs in a sandbox; no Docker daemon. copy() steps upload through port 5008. Tested SDK line: e2b@2.46.1.

    SDK auth

    • The seed makes one team key per install (e2b_ + 32+ hex). docker compose exec ready cat /run/e2b/sdk.env gives E2B_API_KEY, E2B_API_URL=http://localhost:3000, E2B_SANDBOX_URL=http://localhost:3002. The JS SDK reads those env vars; E2B_DOMAIN is not needed. get_host() returns *.e2b.app, which does not resolve; use E2b-Sandbox-Id / E2b-Sandbox-Port headers on 3002.

    Not verified

    • Any end-to-end Embed run on WSL2.
    • Docker Desktop as the Docker host (the nsenter -t 1 design suggests Docker Engine inside Ubuntu instead).
    • kvm_intel/kvm_amd autoload in WSL; 2048 hugepages in WSL; WSL idle shutdown and memory reclaim effects.
    • Whether the KB5127648 fix has shipped; the owner's CPU vendor, RAM and update level.
    • Port 5432 collision with the owner's other Postgres.
    • Desktop/VNC template on self-host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions