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.
Always On
Run agents 24/7 without keeping your local machine running.
Quick Start
Run the official Docker image:http://localhost:12233.
Test it:
What’s Included
| Component | Version | Purpose |
|---|---|---|
| AgentUse | Latest | Bun-compiled binary |
| Node.js | 20.x | Run JavaScript scripts |
| Python | 3.12 | Run Python scripts |
| git | Latest | Version control operations |
| curl | Latest | HTTP requests |
| jq | Latest | JSON processing |
| bash | Latest | Shell scripts |
Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY | Yes* | Anthropic Claude API key |
CLAUDE_CODE_OAUTH_TOKEN | Yes* | Long-lived OAuth token from claude setup-token (valid 1 year) |
OPENAI_API_KEY | Yes* | OpenAI API key |
OPENROUTER_API_KEY | No | 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
Option 1: Volume Mount
Mount agent files at runtime:Best for development - no rebuild needed when agents change.
Option 2: Extend Base Image
Create a Dockerfile in your project:Best for production - self-contained, versioned, deployable.
Option 3: Docker Compose
Extending the Base Image
Add packages your agents need:Building from Source
Build for your platform:- arm64 (Apple Silicon / Graviton)
- amd64 (Intel/AMD)
Production Deployment
For production use, run behind a reverse proxy with process management.Reverse Proxy with nginx
Process Management with PM2
Rate limiting
Rate limiting
Configure rate limiting in nginx to prevent abuse:
SSL certificates
SSL certificates
Use Let’s Encrypt for free SSL:
Troubleshooting
Container exits immediately
Container exits immediately
Check the logs: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 building a custom image, ensure:Agent file not found
Agent file not found
Check the volume mount:Ensure paths in API requests match container paths.
