Prerequisites
- A Railway account
- The ouroborai monorepo cloned locally
- An Arbitrum RPC URL (Alchemy, Infura, or public)
- An Anthropic API key for the agent runner
- A funded wallet private key (ETH for gas, USDC for x402 settlement)
Deployment
Create a Railway project
Log into Railway and create a new project. Select Deploy from GitHub repo
and connect the ouroborai repository. Railway detects the
Dockerfile in the
project root automatically.If you prefer manual deployment, install the Railway CLI:Configure environment variables
In the Railway dashboard, navigate to your service and open the Variables
tab. Add the following required variables:Add optional variables for full functionality:
Provision Redis (optional but recommended)
Redis enables persistent job queues, conversation threads, and x402 nonce
tracking across server restarts. Without it, these stores fall back to
in-memory and reset on each deploy.In Railway, click New Service and select Redis. Railway automatically
injects
REDIS_URL into your service environment.The API server uses these Redis key prefixes:| Prefix | Purpose |
|---|---|
arb:job:* | Job queue entries |
arb:thread:* | Conversation threads |
arb:nonce:* | x402 nonce deduplication (24hr TTL) |
arb:revenue:* | Payment tracking and revenue stats |
Review the Dockerfile
The project ships a multi-stage Dockerfile that builds all workspace
packages and produces a minimal production image:Build order matters because workspace packages have dependencies:
sdk builds first, then adapters, skills, timeboost, and
smart-account, and finally the api app.@zerodev/*, permissionless, and tslib must be marked as external
in the Bun build configuration to avoid bundling issues.Deploy
Push to your connected branch (or trigger a deploy from the CLI):Railway builds the Docker image, starts the container, and assigns a
public URL.
Verify the deployment
Hit the health endpoint to confirm the server is running:Expected response:Also check the root endpoint for version and chain info:
Troubleshooting
502 Bad Gateway on deploy
502 Bad Gateway on deploy
Railway needs the server to bind to
0.0.0.0, not localhost. The ouroborai
API server already binds to 0.0.0.0 by default. Ensure the PORT
environment variable matches what Railway expects (it injects this
automatically).Redis connection refused
Redis connection refused
If using Railway’s Redis add-on, ensure the
REDIS_URL variable is linked
to the correct service. The API server falls back to in-memory stores
gracefully if Redis is unreachable, so the server will start even if Redis
is misconfigured.x402 payments failing
x402 payments failing
Verify that
PAY_TO_ADDRESS is a valid Arbitrum One address and that the
calling wallet has sufficient USDC. Set SKIP_PAYMENT=true for staging
environments where you want to bypass payment verification.