up.sh generates a unique name (agentos-<suffix>), records it in fly.toml, and pairs it with a Postgres app named <app>-db. Later fly commands read the app name from fly.toml, so no --app flag is needed. Start with Deploy AgentOS on Fly.io for prerequisites and the first deployment.
Manage
The platform runs one machine by default. Both deploy scripts pass
fly deploy --ha=false because Fly otherwise creates two machines and doubles the application cost. fly.toml keeps the machine warm with auto_stop_machines = "off" and min_machines_running = 1; scheduled jobs stop when no machine is running. Validate schedule registration and MCP streams before adding machines.
Production auth
Token-Based Authorization protects AgentOS routes by default in production. Startup requiresJWT_VERIFICATION_KEY or a readable JWKS file at the container path in JWT_JWKS_FILE; otherwise the process exits.
Token-Based Auth gives you three things:
- Protected API access. Requests to protected AgentOS routes require a valid token.
/,/health,/info,/docs,/redoc,/openapi.json, and/docs/oauth2-redirectremain public. - Per-request identity. Middleware validates the token and exposes its
user_id, optionalsession_id, scopes, and claims to the request. - Scope-based permissions. Token scopes control access to AgentOS routes and resources.
authorization_config=AuthorizationConfig(user_isolation=True) to AgentOS. See User Isolation.
To disable JWT authentication, set authorization=False in app/main.py, remove JWT_VERIFICATION_KEY and JWT_JWKS_FILE from the Fly secrets, and redeploy. authorization=False disables AgentOS scope enforcement. Configured JWT environment variables continue to enable JWT validation. MCP OAuth remains active when MCP_CONNECT_SECRET is set. Only do this when another layer protects the service.
Customize
Add an agent
Add an agent
Ask your coding agent to run Register it in Local containers hot-reload on save. For production, run
/create-new-agent, or do it by hand. Create agents/my_agent.py:app/main.py:./scripts/fly/redeploy.sh.Change the model
Change the model
app/settings.py defines default_model(), used by every agent. Change it in one place:anthropic to pyproject.toml. Set ANTHROPIC_API_KEY in .env for local runs and .env.production for production, then regenerate pins:docker compose up -d --build. For production:Add tools
Add tools
Agno ships 100+ toolkits. See Toolkits.
Add dependencies
Add dependencies
- Edit
pyproject.toml. - Regenerate pins:
./scripts/generate_requirements.sh(addupgradeto refresh every pin). - Rebuild locally with
docker compose up -d --build, or redeploy with./scripts/fly/redeploy.sh.
Enable Slack
Enable Slack
Set both variables in your env file:Sync with
./scripts/fly/env-sync.sh. The interface activates automatically and routes messages to Agent Builder; change the agent= argument in app/main.py to point at another agent. See Slack setup.Toggle scheduled workflows
Toggle scheduled workflows
The deployment check runs daily by default (
ENABLE_DEPLOY_CHECK=True); it is deterministic and free. Scheduled evals are off by default (ENABLE_SCHEDULED_EVALS=False) because they use model calls. Both workflows stay runnable on demand regardless.Enable pgvector for knowledge bases
Enable pgvector for knowledge bases
Fly’s stock
postgres-flex image supports sessions and memory. Knowledge bases fail at CREATE EXTENSION until the database image includes pgvector. Build a derivative and publish it to a registry Fly can pull from. The commands below use a public Docker Hub repository:FLY_PG_IMAGE applies when the Postgres cluster is created. up.sh reuses an existing cluster, so switching later requires ./scripts/fly/down.sh, which deletes the app, database, and all stored data. Then export FLY_PG_IMAGE and provision again.Format, validate, and run evals
The format, validate, and eval scripts run on the host and need a venv. Set it up once:./scripts/mcp_check.sh runs inside the container, so it needs no venv.
Environment variables
up.sh also reads three variables from your shell when provisioning:
Troubleshooting
flyctl: command not found
flyctl: command not found
Install flyctl, then run
fly auth login. The scripts accept either binary name, flyctl or fly.up.sh pauses asking for a JWT key
up.sh pauses asking for a JWT key
Expected. Mint the key at os.agno.com: connect your OS (Connect OS → Live, enter your Fly URL), then turn on Token-Based Authorization (JWT) under Settings → OS & Security and paste the full PEM. To add a PEM later, set
JWT_VERIFICATION_KEY and run ./scripts/fly/env-sync.sh. To use JWKS, bake or mount the file in the Fly Machine, set JWT_JWKS_FILE to its container path, then sync the variable.up.sh exits: fly.toml carries an app name this script doesn't manage
up.sh exits: fly.toml carries an app name this script doesn't manage
The script only manages names it generated. A different name means continuing would overwrite
fly.toml and abandon that app. Restore the agentos placeholder (or an agentos-* name from a previous run), or tear down first with ./scripts/fly/down.sh.App fails to start in production
App fails to start in production
AgentOS scope enforcement is on whenever
RUNTIME_ENV is not dev. Set JWT_VERIFICATION_KEY and sync. To use JWT_JWKS_FILE, first bake or mount a readable JWKS file at that container path, then sync the variable. env-sync.sh does not upload the file. To disable JWT, set authorization=False in app/main.py, remove both JWT variables from the Fly secrets, and redeploy. MCP OAuth remains active when MCP_CONNECT_SECRET is set.Knowledge bases fail at CREATE EXTENSION
Knowledge bases fail at CREATE EXTENSION
The stock
postgres-flex image has no pgvector; sessions and memory are unaffected. Set FLY_PG_IMAGE to a pgvector-enabled image and recreate the cluster. up.sh reuses an existing cluster, so tear down first with ./scripts/fly/down.sh. See Enable pgvector for knowledge bases.Scheduled jobs never fire
Scheduled jobs never fire
AGENTOS_URL may still be the localhost default. up.sh sets it to https://<app>.fly.dev automatically; for a custom domain or tunnel, set it by hand and run ./scripts/fly/env-sync.sh. Re-running up.sh resets a hand-set value to the generated fly.dev URL, so re-pin it afterwards. The other cause is the machine scaling to zero: keep auto_stop_machines = "off" and min_machines_running = 1 in fly.toml.A second Fly Machine appeared
A second Fly Machine appeared
A plain
fly deploy enables Fly’s default HA topology. Deploy with the scripts to keep one machine; they pass --ha=false. AgentOS claims due schedules through PostgreSQL. This template has not been validated for simultaneous schedule registration and MCP streams across multiple machines.