sandboxd: The Anti-Kubernetes Engine Behind Sleeping Sandboxes and Live Preview URLs
A single Go daemon, SQLite, Docker, and Traefik power a self-hosted sandbox platform that wakes containers on demand, reaps them under memory pressure, and keeps AI app builders cheap enough to run on one box.
- sandboxd treats a preview URL like a sleeping doorbell: requests wake the sandbox, wait for readiness, and only then reach the app.
- The project’s real trick is not isolation theater but a deliberately small control plane built from Go, SQLite, Docker, and Traefik.
- Host-aware reaping and reflink snapshots turn a single machine into dense, cost-conscious sandbox territory.
- Its competitive edge is legibility, because one developer can trace the whole path from HTTP request to live container without a platform team.
A request hits a dead URL. Traefik catches it, `sandboxd` holds the connection open, a container wakes, `runtimed` confirms the dev server is ready, and only then does the response flow through. That is the whole pitch in one motion: a preview that behaves like infrastructure magic, but is built from parts most engineers already trust.
you may checkout sandboxd project, it allow you ti run on your own vps plenty of sandboxes for differents usages : https://github.com/tastyeffectco/sandboxd
A URL That Sleeps Until You Touch It
The hook is behavioral, not architectural. A preview URL does not mean a hot container sitting around burning money. It means a request can arrive at a dormant sandbox, wake the machine behind it, and wait until the app is actually usable.
That makes the experience feel immediate to the user and stingy to the operator. The system spends compute only when someone needs it, which is exactly what AI app builders want when a thousand tiny experiments would otherwise each deserve a permanently warm environment.
The result is a nice inversion of normal preview systems. Most platforms keep the container alive and let the URL stay warm. `sandboxd` makes the URL stay available while the container is allowed to sleep.
Why This Stack Feels So Small
The stack is not accidental minimalism. Go gives the daemon a straightforward concurrency model. SQLite provides a source of truth without introducing a separate database service. Docker is the execution substrate. Traefik handles the edge routing that makes wake-on-request possible.
| Project | Isolation model | Self-hosting | Preview URL behavior | Best for | Trade-off |
|---|---|---|---|---|---|
| sandboxd | Docker containers with host-aware scheduling | Yes | Sleeps until request wakes it | AI app builders who want control and density | Less isolation than microVM-first platforms |
| E2B | Firecracker microVMs | Managed and self-hosted options vary | Usually session-based and warm while active | Agent workloads that need stronger boundaries | Heavier runtime and more platform complexity |
| Vercel Sandbox | Firecracker microVMs | No | Ephemeral, managed, platform-controlled | Teams that want a turnkey hosted primitive | No self-hosting and tighter product limits |
| gVisor / Kata | Kernel or VM-backed sandbox layers | Yes | Depends on the integration layer | Security-sensitive execution under custom ops | More integration work than a ready-made product |
This is what "boring on purpose" looks like in practice. The software is narrow enough that one person can understand the full path from API call to container start, which is a very different proposition from a platform whose behavior disappears behind layers of abstraction.
The Control Plane Is the Brain
The control plane is the part that keeps the whole system honest. It reconciles what SQLite says should exist with what Docker actually has running, which is the right shape for a system that must survive restarts, stale containers, and interrupted work.
That reconciler pattern matters because the daemon is not just launching containers. It is managing lifecycle, reaping idle sandboxes, exposing API endpoints, and keeping the machine from drifting into a state where the database and reality no longer agree.
The practical payoff is resilience. If the daemon restarts, it does not need to rediscover a hidden distributed system. It re-reads local state, checks the host, and converges.
The Runtime Lives Inside the Sandbox
`runtimed` is the in-sandbox supervisor. It watches the dev server, exposes readiness over a Unix socket, and gives the control plane a reliable way to ask whether the guest is actually ready to serve traffic.
That separation is elegant. The control plane knows about lifecycle and scheduling. The runtime knows about the app process, local readiness, and whether the code inside the sandbox is healthy enough to receive a request.
| Responsibility | Control plane | Runtime |
|---|---|---|
| Starts and stops sandboxes | Yes | No |
| Tracks desired state | Yes | No |
| Supervises dev server | No | Yes |
| Reports readiness | Via API and socket | Yes |
| Reconciles host pressure | Yes | No |
This is the bridge that makes the product feel like one system instead of two unrelated daemons. The guest can fail, rebuild, and become ready again without forcing the host to lose the plot.
The Secret Sauce Is Wake-on-Request
This is the piece that makes `sandboxd` feel novel rather than merely competent. The HTTP request is not rejected, redirected, or replaced with a spinner page. It is held open while the sandbox wakes.
That changes the economics and the UX at the same time. Users get a preview URL that behaves like a real endpoint. Operators get scale-to-zero behavior without writing a separate cold-start orchestration stack.
| Pattern | What the user sees | What the operator pays | Failure mode |
|---|---|---|---|
| Always-on previews | Instant responses | Constant idle burn | Wasted capacity |
| Poll-and-redirect | A waiting page or retry loop | Lower idle burn | Clunky user experience |
| Wake-on-request in sandboxd | One URL that becomes live when ready | Idle containers can sleep | Long first request if startup stalls |
This is also why Traefik matters. It is not just an edge proxy here. It is the first switch in the wake chain, the place where a sleeping sandbox becomes a live transaction instead of a dead link.
Density Comes from Ruthless Reaping
This is the anti-theater move in the project. Instead of pretending the host has infinite resources, `sandboxd` watches for pressure and trims back intelligently. That is how you get density without turning the machine into a gamble.
Snapshots Make Cold Starts Feel Warm
The other cheat code is snapshotting. Reflink-based workspace clones let the system start from a golden image instead of rebuilding every sandbox from scratch. For a code environment, that can be the difference between a satisfying boot and a dead pause.
It matters especially for AI workflows, where iteration speed changes behavior. If the environment appears quickly, people keep experimenting. If it drags, they stop trusting the loop.
In other words, the snapshot system is not a neat file-system detail. It is part of the product experience.
What It’s Really Competing With
| Project | Category | What it optimizes for | Where sandboxd differs |
|---|---|---|---|
| E2B | Managed or hybrid AI sandbox | Isolation and SDK polish | sandboxd stays self-hosted and simpler |
| Daytona | Developer environment platform | Operational convenience | sandboxd pushes more control to the operator |
| Vercel Sandbox | Managed compute primitive | Turnkey hosted execution | sandboxd can run on your own VPS |
| Northflank | Platform with secure compute | Broader platform operations | sandboxd is narrower and more legible |
| gVisor | Sandboxing runtime | Isolation boundary strength | sandboxd is an app platform, not a syscall layer |
| Kata Containers | Lightweight VM runtime | Stronger container isolation | sandboxd prioritizes density and simplicity |
| Firejail | Linux app sandboxing | Per-process isolation | sandboxd manages full preview environments |
That comparison is the point. `sandboxd` is not trying to out-platform the platforms. It is carving out a smaller, sharper problem: self-hosted preview sandboxes that wake on demand and stay understandable.
Why This Matters Now
AI app builders need environments that are fast, cheap, and disposable, but still trustworthy enough to expose to users. The market keeps drifting toward managed primitives, yet many teams still want control over cost, routing, and deployment shape.
`sandboxd` reads like a response to that gap. It shows that a single machine, a small amount of software, and a clear control plane can deliver a surprisingly complete experience.
That makes it more than a utility. It is a pattern for building the next layer of AI infrastructure without inheriting the full weight of cloud-native ceremony.





