Railway CLI expert for deployment. Use when users need to deploy apps, manage databases, configure Railway projects, or manage environments.
/plugin marketplace add leobrival/topographic-studio-plugins/plugin install dev@topographic-plugins-officialThis skill inherits all available tools. When active, it can use any tool Claude has access to.
reference/commands-reference.mdreference/common-patterns.mdreference/troubleshooting.mdRailway is a deployment platform that simplifies deploying and managing web applications, databases, and services. This guide provides essential workflows and quick references for common Railway operations.
# Check Railway CLI installation
railway --version
# Authenticate with Railway
railway login
# Create and initialize new project
railway init my-app
# Add a database
railway add --database postgres
# Deploy application
railway up
# View logs in real-time
railway logs --follow
# Initialize project
railway init my-project
# Configure environment variables
railway variables set NODE_ENV=production
railway variables set PORT=3000
# Add database if needed
railway add --database postgres
# Deploy
railway up
# Verify deployment
railway logs --follow
railway status
# Link to existing Railway project
railway link
# Review current status
railway status
# Update environment variables
railway variables set API_KEY=new-value
# Redeploy with changes
railway redeploy
# Follow logs
railway logs --follow
# Create staging environment
railway environment new staging
# Switch to staging
railway environment use staging
# Configure staging-specific variables
railway variables set LOG_LEVEL=debug
# Deploy to staging
railway deploy
# Switch to production
railway environment use production
# Deploy to production
railway deploy
# Add PostgreSQL
railway add --database postgres
# Connect to database
railway connect postgres
# Set database variables in application
railway variables set DATABASE_URL=$(railway variables get DATABASE_URL)
# Run migrations
railway run npm run migrate
# Verify connection
railway ssh --command "psql $DATABASE_URL -c 'SELECT 1'"
# Check deployment status
railway status
# View all logs
railway logs --tail 100
# SSH into service for inspection
railway ssh
# Run diagnostic commands
railway ssh --command "ps aux"
railway ssh --command "df -h"
# Check resource usage
railway open # View in dashboard
When to use which command:
railway initrailway linkrailway up or railway deployrailway addrailway statusrailway logs --followrailway sshrailway environment# New project workflow
railway login
railway init my-app
railway add --database postgres
railway variables set NODE_ENV=production
railway up
# Set variables
railway variables set KEY1=value1 KEY2=value2
# Get specific variable
railway variables get DATABASE_URL
# Import from .env
railway variables set --from-file .env
# Use variables in commands
railway run npm start
# Add database
railway add --database postgres
# Connect interactively
railway connect postgres
# Run SQL commands
railway ssh --command "psql $DATABASE_URL -c 'CREATE TABLE users (...)'"
# Run migrations
railway run npm run migrate
# Services on same environment communicate by name
railway variables set API_URL=http://api-service:3000
# Within application, use service name as hostname
fetch('http://api-service:3000/endpoint')
Common Issues:
Deployment fails to start
railway logs --tail 50Cannot connect to database
railway variables get DATABASE_URLEnvironment variables not loading
railway redeploy after setting variablesService unreachable after deployment
railway ssh --command "curl http://localhost:3000"SSH or access failing
railway statusFor detailed troubleshooting steps, see the Troubleshooting Guide.
Load as needed for detailed information:
Commands Reference - Complete CLI command documentation with all flags and options. Use when you need exact syntax or flag details for any Railway command.
Common Patterns - Real-world patterns and workflows for development, multi-environment setups, database management, CI/CD integration, monitoring, and backup strategies. Use for implementing specific workflows or deployments.
Troubleshooting Guide - Detailed error messages, diagnosis steps, and resolution strategies for deployments, databases, environments, domains, resources, and access issues. Use when encountering errors or unexpected behavior.
When to use each reference:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.