Deploy AstraBox
AstraBox is self-hosted. You can run the whole service on one Docker host, connect it to OpenSandbox on Kubernetes, or use an OpenSandbox service that your organization already operates. The maintained single-host deployment starts the web console, API, data stores, model and messaging gateways, and the local sandbox service. Agent tasks run in isolated sandboxes.
Choose where Agent sandboxes run
| Deployment | Best for | Where sandboxes run |
|---|---|---|
| One Docker host | Evaluation, development, and a small trusted team | Separate containers on the host Docker daemon |
| Kubernetes with OpenSandbox | Multiple nodes, prewarmed sandboxes, snapshots, and cluster controls | Sandbox Pods created by OpenSandbox |
| An existing OpenSandbox service | Organizations that operate sandbox infrastructure separately | The container runtime configured for that service |
The maintained local deployment has no authentication and listens on loopback only. Configure team login, TLS, and a trusted ingress before making AstraBox reachable from another network.
For Kubernetes and external-service settings, see the OpenSandbox deployment guide.
Run on one Docker host
Build the Agent sandbox image used by the quickstart, provide a model credential, and start the maintained Compose stack:
make build-agent-image
export ANTHROPIC_API_KEY="your-anthropic-api-key"
export ANTHROPIC_MODEL="your-model-name"
scripts/compose.sh up --build -d
Open http://127.0.0.1:8088.
The stack starts the following components:
| Component | Purpose |
|---|---|
| AstraBox API and console | Create and use Agents, Assistants, Sessions, and triggers |
| PostgreSQL | Store AstraBox and LiteLLM data |
| LiteLLM | Route model requests and discover available models |
| Messaging gateway | Connect Agents to messaging platforms |
| OpenSandbox | Create and manage local sandbox containers |
On Linux, scripts/compose.sh detects the Docker socket's group. If detection
does not work for your Docker installation, set its numeric group ID before
starting the stack:
export DOCKER_GID="$(stat -c %g /var/run/docker.sock)"
scripts/compose.sh up --build -d
The AstraBox container can control the mounted Docker daemon. Treat it as a privileged host service and do not expose the local deployment directly to an untrusted network.
Build sandbox images
An Environment connects an Agent to an Agent program and a compatible sandbox image. The image supplies the operating system, CPU architecture, Agent program, commands, and language runtimes available to the Agent.
Build a custom image when every Session needs additional software. Start from the corresponding bundled sandbox image, install and pin the dependencies, and then select the custom image in the Environment. Publish immutable image tags for production deployments.
Agent programs, accounts, and control processes required by a sandbox must already be present when the sandbox starts. Do not depend on a per-Session setup script: a prewarmed sandbox can exist before the Session that uses it.
Bundled sandbox images expose /workspace as the Session workspace. The
Session's Files view reads and writes the same directory. A custom image must
make its configured working directory writable by the Agent program. See the
container reference for the image requirements.
Save and restore data
The maintained Compose deployment stores service data separately from Agent sandboxes:
| Location | Contents |
|---|---|
astrabox-postgres volume | AstraBox and LiteLLM databases |
astrabox-state volume | /data state, generated keys, local Assistant workspaces, and local OpenSandbox metadata |
.astrabox/database-secrets | Generated database credentials and optional bundled-SSO credentials |
| Session sandbox | The Agent's /workspace files |
Session messages and state are stored in the AstraBox database. Files in an Agent sandbox remain available only while that sandbox or a supported snapshot is retained. A terminated sandbox does not preserve files that were not saved elsewhere. Assistant workspaces use the configured Assistant storage when the sandbox is paused or released.
Back up the following as one recovery set:
astrabox-postgres;astrabox-state;.astrabox/database-secrets;- the local vault key or KMS key required to decrypt saved credentials;
- external LiteLLM and Assistant storage, when configured.
The default local Credential Vault key comes from
ASTRABOX_VAULT_MASTER_KEY or /data/vault.key. Encrypted credentials cannot
be restored without the same key.
Make AstraBox available to a team
AstraBox supports OIDC, trusted identity headers from an authenticated gateway, and JWT verification. The bundled SSO overlay starts Casdoor for evaluation:
scripts/compose.sh -f containers/compose.sso.yaml up -d
At the team ingress, terminate TLS, add the public hostname to
ASTRABOX_ALLOWED_HOSTS, prevent direct access to the AstraBox service port,
and use the same login-cookie signing secret on every replica. See
Set up team login for the supported identity configurations.
Check health and sandbox recovery
AstraBox exposes separate liveness and readiness endpoints:
GET /healthz
GET /readyz
/readyz returns 503 after shutdown draining begins. Set the platform's
termination grace period higher than ASTRABOX_SHUTDOWN_DRAIN_SECONDS so
in-flight Agent work has time to finish.
CPU, memory, disk, and sandbox timeouts come from the selected OpenSandbox runtime and its configuration. Before relying on paused sandboxes, verify every Environment that uses them against the deployed backend:
astrabox verify-opensandbox-snapshots
Connect models, messaging platforms, and credentials
- Connect a model service.
- Connect an Agent to a messaging platform.
- Protect credentials used by Agents.
Production checklist
Before inviting users:
- enable authentication and verify authorization for user and machine access;
- terminate TLS at a trusted ingress and set
ASTRABOX_ALLOWED_HOSTS; - use shared persistence and the same signing and encryption keys on every replica;
- back up database data, state, credentials, and encryption keys together;
- verify sandbox access to the model gateway, AstraBox callbacks, remote MCP servers, and other required destinations;
- verify snapshot recovery for every Environment that pauses sandboxes;
- set the required outbound network rules and sandbox permissions;
- run a real Agent task while testing graceful shutdown;
- collect logs, metrics, and traces with explicit access and retention rules.