Skip to main content
This template deploys AgentOS and PostgreSQL with pgvector to Railway. Automatic HTTPS and public domain included.

Step-by-step Guide

1

Install tools

brew install railway
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-railway --name agentos-railway

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

Export your API key

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

Test locally (optional)

docker compose up -d --build
Open http://localhost:8000/docs to verify it works, then stop with docker compose down.
7

Login to Railway

railway login
8

Deploy to Railway

./scripts/railway_up.sh
This creates the Railway project, provisions the database, and deploys your AgentOS.
9

Get your domain

railway open
Find your domain in the Railway dashboard (e.g., https://your-app.railway.app). Navigate to <railway-domain>/docs to see your AgentOS API.
10

Connect your AgentOS to the control plane

  1. Open os.agno.com
  2. Click “Connect OS” and select “Live”
  3. Enter your Railway domain as the endpoint
AgentOS connection dialog

Tips

Update deployment: After making changes to your agents:
railway up --service agent_os -d
View logs:
railway logs --service agent_os
Stop deployment:
railway down --service agent_os
railway down --service pgvector
Project structure:
agentos-railway/
├── agents/              # Your agents
├── teams/               # Your teams
├── workflows/           # Your workflows
├── app/                 # AgentOS directory
├── db/                  # Database tables
├── compose.yml          # Docker Compose configuration
├── Dockerfile           # Container build
├── pyproject.toml       # Python dependencies
└── scripts/             # Helper scripts (including railway_up.sh)

Troubleshooting

Check the Railway logs:
    railway logs --service agent_os
Common issues: missing environment variables, Docker build errors.
Railway’s PostgreSQL may take a moment to provision. Wait 30 seconds and retry.