Skip to main content

Why Self-Host?

Full Control

Host on your infrastructure. Your data and API keys never leave your network.

Scalable

Deploy multiple instances behind a load balancer as demand grows.

API Access

Expose agents via HTTP API for integration with other services.

Reproducible

Same container runs identically across machines. Share your setup with teammates.

Quick Start

Test it:

Local Development

For local development, mount your credentials and workspace instead of using environment variables:
This gives the container access to your OAuth tokens, API keys, and session logs from agentuse auth login. Run agents via exec:
Add alias agentuse-docker='docker exec -it agentuse-dev agentuse' to your shell profile for convenience.
OAuth tokens may expire. If you encounter auth errors, run agentuse auth login on your host to refresh.

Configuration

Environment Variables

At least one AI provider authentication is required. For Anthropic, use either ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN.

Using an Environment File

Restarts and Worker Memory

agentuse serve runs agents in per-project worker processes, and two behaviours matter when you put it behind pm2, systemd, or a container supervisor. A restart releases workers rather than killing them. Runs already in flight keep going in the released worker and finish normally; only the daemon is replaced. A released worker still has a hard deadline, by default the longest in-flight run’s own timeout plus ten minutes of grace, tunable with AGENTUSE_RELEASE_BACKSTOP_SECONDS. Set AGENTUSE_RELEASE_WORKERS=0 if you want the old kill-on-shutdown behaviour instead. Idle workers are recycled once they get heavy. A fresh worker peaks around 130MB of heap; after it has executed runs, that settles at roughly 350-450MB, which a long-lived daemon would otherwise hold forever. When an idle worker is above AGENTUSE_WORKER_RECYCLE_MB (default 300) it is retired through the same release path, so a replacement starts serving immediately. Recycling only happens while the worker is idle, and never within two minutes of it starting. Set AGENTUSE_WORKER_RECYCLE_MB=0 to disable it. After a crash, settle the stragglers. If the host or the container died outright, sessions can be left marked running with no process behind them. agentuse serve sweeps these at startup, but only back 30 days:
Runs that are genuinely still executing are never touched. See CLI Commands.

Including Your Agents

Volume mount (best for development):
Bake into image (best for production):

Docker Compose

Extending the Base Image

Multi-arch Build

Production Deployment

Reverse Proxy with nginx

Troubleshooting

Check logs with docker logs agentuse. Common causes: missing API keys, port already in use.
The official image binds to 0.0.0.0 by default. If using a custom image, ensure:
Check the volume mount with docker exec -it agentuse ls /agents. Ensure API request paths match container paths.