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
Local Development
For local development, mount your credentials and workspace instead of using environment variables:agentuse auth login.
Run agents via exec:
Configuration
Environment Variables
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | Anthropic Claude API key |
CLAUDE_CODE_OAUTH_TOKEN | Long-lived OAuth token from claude setup-token (valid 1 year) |
OPENAI_API_KEY | OpenAI API key |
OPENROUTER_API_KEY | OpenRouter API key |
At least one AI provider authentication is required. For Anthropic, use either
ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN.Using an Environment File
Including Your Agents
Volume mount (best for development):Docker Compose
Extending the Base Image
Multi-arch Build
Production Deployment
Reverse Proxy with nginx
Rate limiting
Rate limiting
SSL certificates
SSL certificates
Troubleshooting
Container exits immediately
Container exits immediately
Check logs with
docker logs agentuse. Common causes: missing API keys, port already in use.Cannot connect to server
Cannot connect to server
The official image binds to
0.0.0.0 by default. If using a custom image, ensure:Agent file not found
Agent file not found
Check the volume mount with
docker exec -it agentuse ls /agents. Ensure API request paths match container paths.