Deploy
Beta TestDeploy your ConnectOnion agents to production. Docker, GCP, AWS - your choice.
Why deploy? Run agents 24/7, scale horizontally, integrate with existing infrastructure. Your agents become production services.
Two Deployment Options
co deploy (Easiest)
Quick deployment to ConnectOnion Cloud. Managed hosting, no infrastructure to manage.
- One command deployment
- Automatic HTTPS
- Re-deploy updates same URL
Self-Host
Full control with your own infrastructure. Use Docker, GCP, AWS, or any VPS.
- Full control
- Custom domains
- Compliance requirements
60-Second Quick Start
Deploy your agent with the CLI - one command:
co deploy Requirements
.co/config.toml (created by co create or co init)co auth)Configuration
Secrets
Secrets from .env are securely passed to your agent:
Note: URL format is {project_name}-{your_address[:10]}.agents.openonion.ai. Re-deploying updates the same URL.
Self-Host with host()
Deploy to your own infrastructure using host():
Run with uvicorn/gunicorn
For full API reference, see host() documentation.
Docker Deployment
The simplest way to deploy - works anywhere Docker runs:
1. Create Your Agent
2. Dockerfile
3. Build & Run
Deploy to Google Cloud Run
Serverless deployment with automatic scaling:
1. Build & Push to Container Registry
2. Deploy to Cloud Run
Security Note
Use Secret Manager for API keys in production instead of environment variables.
Deploy to AWS
Multiple options depending on your needs:
EC2 / Lightsail
Simple VPS deployment. Best for always-on agents.
- Full control over environment
- Predictable pricing
- Easy SSH access
ECS / Fargate
Container orchestration. Best for scaling.
- Auto-scaling built in
- Load balancing
- Rolling deployments
EC2 Quick Deploy
Environment Variables
Configure your agent for different environments:
| Variable | Description | Required |
|---|---|---|
| OPENAI_API_KEY | OpenAI API key for GPT models | Yes* |
| ANTHROPIC_API_KEY | Anthropic API key for Claude | Optional |
| GOOGLE_API_KEY | Google API key for Gemini | Optional |
| RELAY_URL | Custom relay server URL | Optional |
| LOG_LEVEL | Logging verbosity (DEBUG, INFO, WARN) | Optional |
* Or use ConnectOnion managed keys with co auth - no API keys needed!
Best Practices
Security
- Use secret managers for API keys
- Never commit
.co/or.env - Use non-root container users
- Enable HTTPS for all endpoints
Reliability
- Add health checks to containers
- Set up automatic restarts
- Configure logging and monitoring
- Use persistent volumes for keys
