Deploying Agents
rax deploy scaffolds a Dockerfile and the provider’s config file, then runs the provider’s CLI. It does not run your tests or guess your secrets: you set API keys in the provider after the first deploy.
rax deploy up --target fly --dry-run # check prerequisites, change nothingrax deploy up --target fly # scaffold + deployrax deploy status # target is auto-detected from config filesrax deploy logs -frax deploy downTargets
Section titled “Targets”| Target | Config file | How it deploys |
|---|---|---|
local (default) |
docker-compose.yml |
Docker Compose on this machine |
fly |
fly.toml |
flyctl |
railway |
railway.json |
railway up (links the project first if needed) |
render |
render.yaml |
Git push to a connected repo; the CLI only validates the blueprint |
cloudrun |
cloudbuild.yaml |
gcloud run deploy --source . |
digitalocean |
App Platform spec | doctl (--gpu adds a GPU Droplet with Ollama) |
--scaffold-only writes the files and prints the next steps without deploying. If you omit --target, the command detects it from files already in the directory.
| Mode | What runs | Use for |
|---|---|---|
daemon (default) |
The full agent with the gateway loop: heartbeat, cron, channels | Always-on agents |
sdk |
A light HTTP server: POST /chat and SSE /chat/stream |
Request-driven agents |
Both expose a health endpoint on port 3000 (HEALTH_PORT). The provider settings follow the mode, because a daemon that is stopped between requests misses its cron fires:
- SDK server security.
/chatand/chat/streamrequireAuthorization: Bearer <RAX_API_KEY>. SetRAX_API_KEYas a secret on your platform; if it is unset the server generates a key and prints it once in its log. Request bodies are capped at 1 MiB and no CORS headers are sent./health,/readyand the agent card stay open for probes.rax deployalso writes a.dockerignorethat excludes.gitand.env*from the image. - Fly.io. Daemon sets
auto_stop_machines = "off"andmin_machines_running = 1. SDK mode may scale to zero. - Cloud Run. Daemon adds
--min-instances=1and--no-cpu-throttlingso CPU stays allocated between requests. - Render. Daemon needs an always-on instance. Use the
starterplan or higher; free web services spin down when idle.
Naming
Section titled “Naming”--name becomes the app or service name (raxd-<name>) and appears in generated files, so it is validated, not rewritten:
/^[a-z0-9][a-z0-9-]{0,40}$/Lowercase letters, digits and -, starting with a letter or digit, at most 41 characters. An invalid --name stops the command with an error. When you omit --name, the name comes from package.json (or the directory) and is slugified to fit.
Google Cloud Run: authenticated by default
Section titled “Google Cloud Run: authenticated by default”The deployed service uses --no-allow-unauthenticated. Callers need an IAM identity:
curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" https://<service-url>/healthTo make the API public, opt out explicitly:
rax deploy up --target cloudrun --allow-unauthenticatedThat flag makes the whole agent API reachable by anyone with the URL. Do it only when something else (your own auth, a gateway) protects the agent.
Set secrets after the deploy, for example with gcloud run services update raxd-<name> --set-secrets ANTHROPIC_API_KEY=anthropic-key:latest.
Render: blueprint steps
Section titled “Render: blueprint steps”Render has no CLI command that creates a service from a blueprint. rax deploy up --target render scaffolds render.yaml and the Dockerfile, validates the blueprint if the render CLI is installed, and prints these steps:
- Commit
render.yamland the Dockerfile, and push to GitHub, GitLab or Bitbucket. - Open the Render dashboard Blueprints page and choose New Blueprint Instance.
- Connect the repo. Render reads
render.yamland creates the service. - Set
ANTHROPIC_API_KEY(andTAVILY_API_KEYif you use web search) in the dashboard.
Later pushes to the tracked branch deploy automatically (autoDeploy: true). rax deploy down cannot delete a Render service; delete it in the dashboard.
Before you deploy a gateway agent
Section titled “Before you deploy a gateway agent”- Read the Production Checklist.
- Put sender allowlists on any channel the agent listens to, as
platform:userIdentries. See Agent Gateway. - Gateway webhook ingress binds
127.0.0.1by default and is meant to sit behind a reverse proxy that terminates TLS. See Serving webhooks. - Waiting events in the gateway’s inbound queue are in memory and lost on restart; scheduled fires are replayed by the schedule registry. Make scheduled instructions safe to repeat.
Install
Bun (recommended)bun add reactive-agentsNode 22.5+npm install reactive-agentsGet notified on new releases