Sandboxes

3 min read

Teploy Sandboxes runs isolated, ephemeral execution environments on servers you already manage with Teploy. It is early access and self-hosted: there is no hosted control plane, and your workloads stay on your own machines. Hosted sandboxes on Teploy Cloud are not part of this.

The engine is teploy-sandbox v0.1.0, source-available under FSL-1.1-MIT (becomes MIT after two years), published at github.com/useteploy/teploy-sandbox.

What a sandbox is

By default, a sandbox is a Docker container started by teploy-sandbox from any Docker image on your server. Each sandbox gets its own filesystem and network namespace, persists state between commands, and is removed when its TTL expires unless you stop it or ask for --on-expire stop.

Defaults for a new sandbox:

  • Network: none (no network interface except loopback). Opt into allowlist (HTTP proxy with built-in package registries) or open.
  • Lifetime (TTL): 30 minutes by default, 24 hours maximum.
  • Resources: 1 CPU, 1024 MiB memory, 256 processes (--cpus, --memory-mb, --pids).
  • Execution: commands run via sh -c in /work, as the image's ship user when present and as root otherwise (--run-as root forces root).

Persistent lifecycle

A sandbox does not have to die with its container:

  • stop commits the sandbox's filesystem, removes the container, and keeps the run as stopped under the same ULID. While stopped it costs disk and nothing else, and is retained for 14 days (336h) by default.
  • resume recreates the container from the stop snapshot under the same ID with a new TTL.
  • fork starts a new sandbox from a running or stopped sandbox's filesystem and settings, leaving the source unchanged.

Two ways to drive it

  1. The Teploy CLI (teploy sandbox) — installs teploy-sandbox v0.1.0 as a systemd service on a server (teploy sandbox host <server>) and talks to it over SSH port forwarding to 127.0.0.1:7439. Nothing the engine serves is exposed on a public address, and the bearer token never leaves the SSH connection.
  2. The HTTP API directly — the same bearer-authenticated /v1 HTTP API that Ship uses for agent runs, including features the CLI does not wrap yet (recoverable execs, writable leases, explicit snapshots, warm repo caches, and experimental engine features).

Drivers and early-access status

Surface Status in v0.1.0
Docker driver (--driver docker) Default. Installed and managed by teploy sandbox host.
VM driver (--driver vm) Experimental. Cloud Hypervisor on KVM with ZFS volumes and teploy-guestd over vsock. Not installed by teploy sandbox host — requires manual host setup on Linux 5.13+ with KVM, ZFS, cgroup v2, seccomp, and Landlock.
Memory snapshots (--vm-memory-snapshots) Experimental, off by default, VM driver only. Saves RAM alongside disk on stop; disk remains the durable truth.
Off-host S3 storage & access listener Experimental, off by default (engine API only).
Hosted sandboxes on Teploy Cloud Not part of this (self-hosted only).

Where to go next

  • Quick start — install the engine on a server and run your first sandbox
  • CLI reference — every teploy sandbox subcommand, flag, exit code, and --json shape
  • Engine & HTTP API — running teploy-sandbox directly, drivers, and the /v1 wire contract
  • Security model — egress tiers, run users, daemon boundaries, and VM confinement

The engine repository is github.com/useteploy/teploy-sandbox.