---
url: "https://railway.com/agents"
title: Railway for AI Coding Agents
domain: railway.com
locale: en
type: landing
words: 231
cited_by: 1
indexed_by: stealpage
---

## Ship with your agents

`$ curl -fsSL agents.railway.com | sh`

One command setup or

## What a session looks like

1.  ### Set up
    
    You: Install railway agent tools using railway.com
    
    -   `curl -fsSL agents.railway.com | sh`: cli · skill · mcp
    -   `railway whoami`: signed in
    
    Agent: Railway is set up: the CLI, the skill and MCP, signed in as you.
    
2.  ### Deploy the app
    
    You: Deploy this app to Railway and give it a domain
    
    -   `create_project my-app`: created
    -   `railway up`: deployed
    -   `generate_domain web`: domain added
    
    Agent: Done. Web is live at my-app.up.railway.app.
    
3.  ### Add Postgres
    
    You: Add my api service, with a Postgres database
    
    -   `create_service api`: created
    -   `railway up ./api -s api`: deployed
    -   `deploy_template postgres`: deployed
    -   `add_reference_variable api`: DATABASE\_URL set
    
    Agent: Done. Api and Postgres are in. Api is redeploying.
    
4.  ### Fix the crash
    
    You: The api just crashed. Why?
    
    -   `railway-agent "why did api crash?"`: pg not installed
    -   `edit api/package.json`: pg → dependencies
    -   `railway up ./api -s api`: deployed
    
    Agent: Fixed. Pg was only a dev dependency. I moved it and redeployed.
    
5.  ### Check production
    
    You: Is everything running in production now?
    
    -   `environment_status production`: 3 active
    -   `list_deployments api`: success · 1 min ago
    
    Agent: Yes. All 3 services are running, right on track.
    

Set up

Agent guides

## Set up Railway in your agent

### OpenCode by Anomaly

`$ curl -fsSL agents.railway.com | sh`