Skip to main content
This template deploys AgentOS and PostgreSQL to AWS. It includes example agents ready to use after deployment, managed infrastructure, and a public endpoint.

Prerequisites

Development

Run locally before deploying to AWS.
1

Clone the template

git clone \
  https://github.com/agno-agi/agentos-aws-template.git \
  agentos-aws

cd agentos-aws
The template includes the following agents:
AgentDescription
Knowledge AgentAnswers questions from your documents using Agentic RAG.
MCP AgentConnects to external tools via Model Context Protocol.
2

Set your API key

cp example.env .env
Edit .env and add your OPENAI_API_KEY.
3

Start AgentOS

./scripts/venv_setup.sh && source .venv/bin/activate
ag infra up --env dev
4

Load knowledge

docker exec -it agentos-aws-template-api python -m agents.knowledge_agent
This loads the default documents into the Knowledge Agent’s vector database.
5

Confirm it's running

Navigate to localhost:8000/docs to see your AgentOS API.
6

Connect to the control plane

  1. Go to os.agno.com
  2. Click Connect OS → Select Local
  3. Enter http://localhost:8000
Your AgentOS is running locally.

Production

Deploy to AWS when you’re ready to go live.

Prerequisites

1

Verify AWS credentials

aws sts get-caller-identity
2

Configure AWS settings

Update infra/settings.py with your subnets and image registry:
infra/settings.py
infra_settings = InfraSettings(
    aws_region="us-east-1",
    aws_az1="us-east-1a",
    aws_az2="us-east-1b",
    aws_subnet_ids=["subnet-xxx", "subnet-yyy"],
    image_repo="your-dockerhub-username",
    push_images=True,
)
Set aws_az1 and aws_az2 to match your subnet availability zones. For ECR, use image_repo="[ACCOUNT_ID].dkr.ecr.[REGION].amazonaws.com".
3

Authenticate to your registry

For Docker Hub:
docker login
For ECR, create the repository and authenticate:
aws ecr create-repository --repository-name agentos-aws-template --region us-east-1
aws ecr get-login-password --region us-east-1 | \
  docker login --username AWS --password-stdin [ACCOUNT_ID].dkr.ecr.us-east-1.amazonaws.com
4

Set production secrets

cp infra/example_secrets/prd_api_secrets.yml infra/secrets/prd_api_secrets.yml
cp infra/example_secrets/prd_db_secrets.yml infra/secrets/prd_db_secrets.yml
Edit prd_api_secrets.yml and add your OPENAI_API_KEY. Edit prd_db_secrets.yml and set MASTER_USERNAME and MASTER_USER_PASSWORD for your production database.
5

Deploy

ag infra up --env prd
Takes about 5 minutes. The command builds and pushes your image, provisions RDS PostgreSQL, creates ECS resources, and configures an application load balancer.
6

Load knowledge

Use ECS Exec to load documents into the Knowledge Agent’s vector database:
ECS_CLUSTER=agentos-aws-template-prd
TASK_ARN=$(aws ecs list-tasks --cluster $ECS_CLUSTER --query "taskArns[0]" --output text)

aws ecs execute-command --cluster $ECS_CLUSTER \
  --task $TASK_ARN \
  --container agentos-aws-template-prd-api \
  --interactive \
  --command "python -m agents.knowledge_agent"
7

Get your endpoint

Find your Load Balancer DNS in the AWS Console (EC2 → Load Balancers). Navigate to <load-balancer-dns>/docs to confirm the API is running.
8

Connect to the control plane

  1. Go to os.agno.com
  2. Click Connect OS → Select Live
  3. Paste your AWS endpoint
Your AgentOS is live on AWS.

Next Steps