Prerequisites
- A Starter Template repo set up locally (setup)
- A Railway account
- The Railway CLI installed and authenticated (
railway login) OPENAI_API_KEYexported in your shell (the script reads it from there)
Step 1: Provision and deploy
- Creates a Railway project called
agent-os. - Deploys a
pgvectorPostgres service from the public template. - Creates the
agent-osapplication service and forwards the database connection vars plusOPENAI_API_KEYandPORT. - Builds and deploys the app from the current directory.
- Issues a public Railway domain.
Step 2: Load the Knowledge Agent in production
The local index doesn’t carry over. Run the loader against the deployed service:Step 3: Verify
Once the domain resolves:- Open os.agno.com.
- Click Add OS, choose Live, paste your Railway URL.
- Click Connect.
Add more env vars
The deploy script only forwardsOPENAI_API_KEY and the database vars. To add more (Anthropic, Google, custom MCP secrets), set them on the service directly:
Redeploys
After code changes:-d flag detaches so the CLI doesn’t tail logs. Use railway logs --service agent-os to follow them.
What you get
| Resource | Purpose |
|---|---|
agent-os service | The AgentOS app, FastAPI on port 8000 |
pgvector service | Postgres with the pgvector extension, used for sessions, memory, and the knowledge index |
| Railway-issued domain | Public HTTPS endpoint |
Operations
| Task | Command |
|---|---|
| Tail logs | railway logs --service agent-os |
| Open the dashboard | railway open |
| Run a command in the container | railway run <command> |
| Stop the app | railway down --service agent-os |
| Stop Postgres | railway down --service pgvector |
railway.json.