Local and self-hosted
Docker Sandboxes, the open-source E2B runtime, Microsandbox and Kata give you microVM isolation on your own laptop or servers, with no vendor control plane.
You don't need a cloud account to give an agent its own microVM. The same isolation now runs on a laptop, a home server or your own data centre. What you give up is the control plane: the part of a hosted platform that decides when to sleep, when to wake, where to store snapshots and how to route a webhook to the right machine. With self-hosting, that's either a small part of the open-source project or something you build.
At a glance
| Runs on | Hibernation | Best for | |
|---|---|---|---|
| Docker Sandboxes | Your Mac, Windows or Linux machine (optional experimental cloud) | Stop and restart keep the disk | Letting a coding agent run unsupervised on your own machine |
| E2B runtime | One Linux box with KVM, or your cloud via Terraform | Yes: Firecracker snapshots with pause and resume | The E2B API, but on your hardware |
| Microsandbox | Linux or macOS | Not a focus | Lightweight local isolation for tool calls |
| OpenSandbox, Kata, Agent Sandbox | Your Kubernetes cluster | Via the cluster (see Kubernetes) | Platform teams |
Docker Sandboxes
Docker's sbx CLI runs each coding agent in a microVM with its own kernel and its own Docker daemon, so the agent can build and run containers without touching your machine. It doesn't need Docker Desktop, and local use is free, commercial use included (docs, Docker blog). primary source
- Supported agents: Claude Code, Codex, Copilot, Cursor, Devin, Docker Agent, Droid, Kiro, OpenCode, plus a plain shell (agents). Start one with
sbx run claude. - Network and secrets: all outbound traffic goes through a proxy on the host, with presets such as "balanced" and "locked down" and per-host allow rules. The proxy injects credentials, so your real API key stays on the host and never enters the VM. This is the pattern we recommend everywhere (see Operations).
- Persistence: a sandbox lasts until you remove it. Stopping and restarting keeps packages, images and files. By default your project folder is mounted into the sandbox, or you can give the agent a private clone.
- Cloud mode:
sbx --cloudruns the same sandboxes on Docker's experimental agentic platform, pay-as-you-go. Cloud sandboxes expire after one hour by default and can't mount your local folder.
For loops: it gives your laptop a safe place for long /goal runs with permissions switched off. It is not a hibernating host. When your machine sleeps, so does the agent.
E2B self-hosted
The engine behind E2B is open source under Apache-2.0 (the e2b-dev/infra repository now redirects to e2b-dev/runtime). Its README describes "Firecracker microVMs that resume from a snapshot". You can run it two ways (GitHub):
- Embed: a single Linux machine with KVM, started with Docker Compose. One machine by design, which is enough for a home lab or a small team.
- Cluster: Terraform for GCP, AWS and Azure, plus a Kubernetes manifest. A comparison describes this path as heavy, with a Nomad and Consul control plane underneath (Helix). secondary reporting
Because it's the same engine, the E2B SDKs, templates (including the claude and codex ones) and pause and resume work against your own installation. If you want E2B's operations team rather than your own, E2B also offers BYOC, a managed deployment in your own cloud account, for enterprise customers (BYOC).
Microsandbox and OpenSandbox
- Microsandbox runs microVMs through libkrun, under Apache-2.0. It claims start times under 100 ms (self-reported) and suits fast, throwaway isolation for an agent's tool calls more than resident agents (Beam comparison). secondary reporting
- OpenSandbox, released by Alibaba in March 2026 under Apache-2.0, is a self-hosted sandbox platform that can use gVisor, Kata Containers or Firecracker underneath (Northflank). secondary reporting
- Kata Containers run each pod in a lightweight VM, and can use Firecracker or Cloud Hypervisor underneath. On Kubernetes, pair them with Agent Sandbox to get one isolated, stateful pod per agent.
When self-hosting makes sense
Code, credentials or customer data that may not leave your network. Self-hosting is often the only option here, and microVM isolation keeps a misbehaving agent from reaching the rest of the host.
An always-on Mac mini, a home server or a small VPS running one harness in a Docker Sandbox or a plain VM is hard to beat for a single personal agent. Hibernation saves little when there's only one machine (see Costs).
Then you want the scheduling that hosted platforms sell: sleep, wake, snapshot storage, routing. The E2B runtime or Agent Substrate on Kubernetes give you that. Expect to own it like any other piece of infrastructure.
Further reading
gVisor and Kubernetes
Modal's sandboxes, plus Google's open-source Kubernetes projects (Agent Sandbox, Agent Substrate, kagent) for a hibernating agent fleet on your cluster.
Running a harness on a host
The general recipe for putting Claude Code, Codex, Hermes, OpenClaw, Kimi or DeepSeek on a sleeping microVM, and what makes a harness sleep well.