| name | railway-deploy |
| description | Deploys Lucid Agents to Railway. Handles GitHub repo creation, Railway service
setup, environment variables, and domain configuration. Use when shipping an
agent to production on Railway.
|
Railway Deploy
Deploy agents to Railway with x402 payment configuration.
Prerequisites
brew install gh
gh auth login
npm install -g @railway/cli
railway login
Required Environment Variables
export RAILWAY_TOKEN="<your-railway-token>"
export PAYMENTS_RECEIVABLE_ADDRESS="<your-wallet-address>"
Step 1: Create GitHub Repository
cd <agent-name>
git init
git add .
git commit -m "Initial commit: <agent-name>"
gh repo create <username>/<agent-name> --public --source=. --push
Step 2: Link to Railway Project
railway init
railway link --project <project-id>
echo '{"project":"<project-id>"}' > railway.json
Step 3: Create Service
railway add -s <agent-name> \
-v "PAYMENTS_RECEIVABLE_ADDRESS=<wallet>" \
-v "FACILITATOR_URL=https://facilitator.daydreams.systems" \
-v "NETWORK=base"
If service already exists:
railway variables set \
PAYMENTS_RECEIVABLE_ADDRESS=<wallet> \
FACILITATOR_URL=https://facilitator.daydreams.systems \
NETWORK=base \
--service <agent-name>
Step 4: Deploy
railway up --detach --service <agent-name>
Step 5: Configure Domain
railway domain --service <agent-name>
Step 6: Verify Deployment
sleep 90
railway service status --service <agent-name>
curl -s https://<agent-name>-production.up.railway.app/health
curl -s -X POST https://<agent-name>-production.up.railway.app/entrypoints/overview/invoke \
-H "Content-Type: application/json" -d '{}'
Environment Variables Reference
| Variable | Value | Purpose |
|---|
PAYMENTS_RECEIVABLE_ADDRESS | 0x... | Your wallet for x402 payments |
FACILITATOR_URL | https://facilitator.daydreams.systems | Payment processing |
NETWORK | base | Blockchain network |
PORT | (auto) | Railway sets this automatically |
Troubleshooting
Build Fails
railway logs --build --service <agent-name>
Service Not Found
railway service status
railway status
Unauthorized
railway logout
railway login
export RAILWAY_TOKEN="<project-token>"
Domain Not Working
railway domain --service <agent-name>
railway service status --service <agent-name>
Output
Provide:
- GitHub URL:
https://github.com/<user>/<agent-name>
- Railway URL:
https://<agent-name>-production.up.railway.app
- Deployment status: SUCCESS/FAILED
- Health check result: OK/ERROR
Next Step
→ Update portfolio and announce the new agent