Getting StartedDeploy

Deploy

Beta

Deploy 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

Recommended

co deploy

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:

Terminal
# Create an agent project co create my-agent # Navigate to the project cd my-agent # Deploy to ConnectOnion Cloud co deploy
output
Deploying to ConnectOnion Cloud...
 
Project: my-agent
Source: /Users/me/my-agent
Package: 12.3 KB (8 files)
Env: /Users/me/my-agent/.env (3 keys)
 
Uploading package to https://oo.openonion.ai...
Deployment: a1b2c3d4
Building container on ConnectOnion Cloud...
[1/100] status: deploying
[2/100] status: running
 
Deployed!
Agent URL: https://my-agent-0x7a9f3b2c.agents.openonion.ai
Dashboard: https://o.openonion.ai/dashboard

co deploy Requirements

Initialized ConnectOnion project
.co/host.yaml (created by co create or co init)
Authenticated (co auth)

Configuration

.co/host.yaml
# .co/host.yaml name: my-agent entrypoint: agent.py env: .env

Environment Variables

Environment variables from .env are securely passed to your agent:

.env
# .env OPENAI_API_KEY=sk-xxx DATABASE_URL=postgres://...

Note: URL format is {project_name}-{your_address[:10]}.agents.openonion.ai. Re-deploying updates the same URL.

Template Deploys with Skills

Deploy a built-in template plus any combination of skills — no local project needed. The CLI creates a temporary project, bundles your skills into .co/skills/, deploys, and cleans up:

Terminal
co deploy --template co-ai --name linkedin-agent \ --skills ~/skills/linkedin-login ~/skills/linkedin-post-submit
output
Creating temporary co-ai project...
 
Deploying to ConnectOnion Cloud...
 
Project: linkedin-agent
Skills:
~/skills/linkedin-login -> .co/skills/
~/skills/linkedin-post-submit -> .co/skills/
 
Deployment: aea819bb
Building container on ConnectOnion Cloud...
 
Deployed!
Agent URL: https://linkedin-agent-0x7a9f3b2c.agents.openonion.ai

--name sets the project name and URL (default: {template}-agent) — different skill combinations run side by side instead of overwriting each other.

--skills takes one or more paths. A path that is itself a skill (contains SKILL.md) lands at .co/skills/{dirname}/; a directory of skills has its contents merged in.

The co-ai image ships Chrome + Xvfb + Node.js, so browser skills and their node scripts work out of the box.

Builds run in the background — if the CLI stops polling before a slow image finishes, the deploy continues server-side. Check progress with co status.

Choose a Dedicated Server Region

Use co server new for a separate machine, then deploy your agent onto it. Sydney remains the default. Melbourne offers another Australian location; Singapore, Iowa, and Oregon are also available when explicitly selected.

Terminal
# Create one dedicated browser-agent server in Melbourne co server new prod --machine e2-medium --region australia-southeast2 # Deploy your initialized agent project onto it co deploy --to prod

Region IDs: australia-southeast1 (Sydney), australia-southeast2 (Melbourne), asia-southeast1 (Singapore), us-central1 (Iowa), and us-west1 (Oregon). The CLI reads available regions from the pricing API. Region selection does not migrate an existing server, and quota or capacity can still prevent creation.

Server credit is charged for 12 months up front: US$360 for e2-small or US$660 for e2-medium, with the same price in every listed region. Review the live quote before confirming. Failed provisioning reports whether the full refund succeeded; do not retry an uncertain purchase until its status is checked.

Self-Host Paths

Self-Host with host()

Deploy to your own infrastructure using host():

agent.py
# agent.py from connectonion import Agent, host agent = Agent("my-agent", tools=[my_tool]) # Export ASGI app for uvicorn/gunicorn app = host.app(agent) if __name__ == "__main__": host(agent)

Run with uvicorn/gunicorn

code
# Direct python agent.py # Uvicorn uvicorn agent:app --workers 4 # Gunicorn gunicorn agent:app -w 4 -k uvicorn.workers.UvicornWorker

For full API reference, see host() documentation.

Docker Deployment

The simplest way to deploy - works anywhere Docker runs:

1. Create Your Agent

agent.py
# agent.py from connectonion import Agent, host def search(query: str) -> str: """Search for information.""" return f"Results for: {query}" agent = Agent( name="my-agent", tools=[search], system_prompt="You are a helpful assistant." ) # Host the agent host(agent)

2. Dockerfile

Dockerfile
FROM python:3.11-slim WORKDIR /app # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy agent code COPY agent.py . # Run the agent CMD ["python", "agent.py"]

3. Build & Run

Terminal
# Build the image docker build -t my-agent . # Run with API key docker run -d \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ --name my-agent \ my-agent
output
Building image...
Successfully built a1b2c3d4e5f6
Successfully tagged my-agent:latest
 
Container started: my-agent
Agent serving at: 0x3d4017c3e843895a...

Deploy to Google Cloud Run

Serverless deployment with automatic scaling:

1. Build & Push to Container Registry

Terminal
# Authenticate with GCP gcloud auth login # Set project gcloud config set project YOUR_PROJECT_ID # Build and push gcloud builds submit --tag gcr.io/YOUR_PROJECT_ID/my-agent

2. Deploy to Cloud Run

Terminal
gcloud run deploy my-agent \ --image gcr.io/YOUR_PROJECT_ID/my-agent \ --platform managed \ --region us-central1 \ --set-env-vars "OPENAI_API_KEY=sk-..." \ --allow-unauthenticated
output
Deploying container to Cloud Run service [my-agent]...
Done.
 
Service URL: https://my-agent-abc123-uc.a.run.app
Agent address: 0x3d4017c3e843895a92b70aa74d1b7ebc...

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

Terminal
# SSH to your EC2 instance ssh -i your-key.pem ubuntu@your-instance-ip # Install dependencies sudo apt update && sudo apt install -y python3-pip docker.io # Clone and run git clone https://github.com/your/agent-repo.git cd agent-repo docker build -t my-agent . docker run -d -e OPENAI_API_KEY=$OPENAI_API_KEY my-agent

Environment Variables

Configure your agent for different environments:

VariableDescriptionRequired
OPENAI_API_KEYOpenAI API key for GPT modelsYes*
ANTHROPIC_API_KEYAnthropic API key for ClaudeOptional
GOOGLE_API_KEYGoogle API key for GeminiOptional
RELAY_URLCustom relay server URLOptional
LOG_LEVELLogging 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

Ready to Deploy?

Your agents are production-ready. Ship them!

Star us on GitHub

If ConnectOnion saves you time, a ⭐ goes a long way — and earns you a coffee chat with our founder.