Getting started
This tutorial takes you from nothing to a running sandbox stack in about ten minutes. At the end you will have a worker polling Anthropic’s queue for sessions and an MCP tunnel listening locally.
Prerequisites
Section titled “Prerequisites”You need git and one of the following, in order of preference: Docker with the compose plugin, Podman with compose support, or Bun 1.3 or later for a tunnel-only setup. You also need a Claude Managed Agents environment key from the Anthropic Console; the sandbox contract explanation covers what this key is and why it is the only credential the host ever holds.
Install with the launcher
Section titled “Install with the launcher”The launcher clones the repository if needed, probes your machine, prints its decision trail, and starts the best mode it finds.
git clone https://github.com/danielbodnar/systemd-claude-sandbox.gitcd systemd-claude-sandboxbash install.shA typical decision trail looks like this:
install.sh: platform: linuxinstall.sh: already inside a clone: /home/you/systemd-claude-sandboxinstall.sh: probes: engine=docker compose=docker compose bun=yes just=yes vscode=no devcontainer-cli=devcontainerinstall.sh: decision: compose stack via just (engine: docker)Or bring the stack up manually
Section titled “Or bring the stack up manually”-
Copy the environment template and fill in your credentials.
Terminal window cp .env.example .envSet
ANTHROPIC_ENVIRONMENT_KEYandANTHROPIC_ENVIRONMENT_IDfrom your Console-createdself_hostedenvironment. LeaveANTHROPIC_API_KEYout; the worker host must never hold it. -
Build and start the stack.
Terminal window just buildjust upTerminal window docker compose builddocker compose up -d -
Confirm both services are healthy.
Terminal window just ps# NAME STATUS# claude-sandbox-worker-1 Up# claude-sandbox-mcp-tunnel-1 Up -
Watch the worker claim its first session.
Terminal window just logs workerCreate a session against your environment from any machine that holds your API key, and the worker picks it up within a poll interval.
What you now have
Section titled “What you now have”- compose.yaml the stack definition
- .env your credentials, never committed
Directorysandbox/
- Dockerfile worker and dev images, one lineage
- spawn.sh optional per-session isolation
Directorymcp-tunnel/ Streamable HTTP reverse proxy
- …
Directoryhost/systemd/ unit for production hosts
- …
The tunnel listens on 127.0.0.1:8787 and stays loopback-only until you choose a publish transport, which is an open decision awaiting maintainer confirmation.
Next steps
Section titled “Next steps”- Deploy to your own host turns this local stack into a supervised service on a server.
- Compose services reference explains every service and volume you just started.