Skip to main content
This template runs AgentOS on your own production-grade AWS infrastructure with ECS Fargate, RDS PostgreSQL, and an application load balancer.

Prerequisites

Step-by-step Guide

1

Install tools

2

Create and activate a virtual environment

uv venv --python 3.12
source .venv/bin/activate
3

Install Agno

uv pip install -U 'agno[infra]'
4

Create your codebase

ag infra create --template agentos-aws --name agentos-aws

cd agentos-aws

Or clone directly: git clone https://github.com/agno-agi/agentos-aws-template.git
5

Set your API key

export OPENAI_API_KEY=sk-***
Agno works with any model provider. Just update the agents in your codebase.
6

Configure AWS settings

Update infra/settings.py with your AWS configuration:
infra_settings = InfraSettings(
    aws_region="us-east-1",
    subnet_ids=["subnet-xxx", "subnet-yyy"],
    image_repo="[ACCOUNT_ID].dkr.ecr.us-east-1.amazonaws.com",
)
7

Test locally (optional)

ag infra up
Open http://localhost:8000/docs to verify it works.
8

Deploy to AWS

ag infra up prd:aws
Press Enter to confirm. This creates:
  • Docker image pushed to ECR
  • RDS PostgreSQL instance
  • ECS Cluster, Service, and Task Definition
  • Application Load Balancer with Target Group
RDS takes about 5 minutes to provision. Monitor progress on the AWS Console.
9

Get your endpoint

Find your Load Balancer DNS in the AWS Console (EC2 → Load Balancers). Navigate to https://<load-balancer-dns>/docs to see your AgentOS API.
10

Connect to the AgentOS control plane

  1. Open os.agno.com
  2. Click “Connect OS” and select “Live”
  3. Enter your Load Balancer DNS as the endpoint
AgentOS connection dialog
Your AgentOS is now deployed on AWS and connected to the control plane. You can now use it to build and deploy agents to production.

Tips

Update deployment: After making changes to your agents:
ag infra patch prd:aws
Stop deployment:
ag infra down prd:aws
This removes all AWS resources including the database. Back up your data first.
agentos-aws/
├── agents/ # Your agents
├── teams/ # Your teams
├── workflows/ # Your workflows
├── app/ # AgentOS directory
├── db/ # Database tables
├── infra/ # AWS infrastructure configuration │
└── settings.py # InfraSettings (region, subnets, etc.)
├── compose.yml # Docker Compose for local testing
├── Dockerfile # Container build
└── pyproject.toml # Python dependencies
The ag infra up prd:aws command provisions the following AWS resources:
  • ECR: Container registry for your Docker image
  • ECS Fargate: Serverless container hosting
  • RDS PostgreSQL: Managed database with pgvector
  • Application Load Balancer: HTTPS endpoint
  • AWS Secrets Manager: Secure credential storage
  • Security Groups: Network access controls
Estimated monthly costs (US East):
  • ECS Fargate: $30-50
  • RDS db.t3.micro: $15-20
  • Load Balancer: $20-25
Total: ~$65-100/month. Use the AWS Pricing Calculator for detailed estimates.

Troubleshooting

The RDS instance takes about 5 minutes to provision. Check status in the AWS Console (RDS → Databases).
View task logs in CloudWatch. Common issues: missing environment variables, incorrect database connection string.
The ECS service may still be starting. Wait 2-3 minutes for health checks to pass.