Quick Deploy
Deploy LiteLLM to Railway with one click:Click Deploy Button
Configure Template
- Project name
- Environment variables (API keys)
- Region preference
Deploy
- Creates a new project
- Provisions PostgreSQL database
- Builds and deploys LiteLLM
- Generates a public URL
Access Service
- Public URL:
https://litellm-production.up.railway.app - Custom domain: Add your own domain in settings
Manual Railway Deployment
From GitHub Repository
Create New Project
- Go to Railway Dashboard
- Click New Project
- Select Deploy from GitHub repo
- Choose
BerriAI/litellmor your fork
Configure Service
- Runtime: Docker
- Build: Uses
/Dockerfile - Start command: Automatic from ENTRYPOINT
Add PostgreSQL
- Click New Service in your project
- Select Database → PostgreSQL
- Railway provisions database and injects
DATABASE_URL
Set Environment Variables
Deploy
From Docker Image
Create New Project
- Click New Project
- Select Deploy a Docker Image
Specify Image
Configure Command
Database Setup
Railway PostgreSQL
Add Database
- In your project, click New
- Select Database → PostgreSQL
- Railway creates database with:
- 1GB storage (Hobby plan)
- Automatic backups
- Private networking
Connection String
Enable Model Storage
Database Migrations
Migrations run automatically on container start using Prisma.Environment Configuration
Required Variables
In Railway service settings, add:Provider API Keys
- OpenAI
- Anthropic
- Google Gemini
- Azure OpenAI
Optional Configuration
Configuration with config.yaml
Mount Configuration File
Create Config in Repo
config.yaml to your repository:Update Start Command
Redeploy
Use Railway Variables
Create Variable Groups
- production - Live environment
- staging - Testing environment
- development - Local development
Reference in Config
Custom Domain
Generate Railway Domain
Add Custom Domain
- In service settings, go to Settings → Networking
- Click Add Custom Domain
- Enter your domain:
api.yourdomain.com
Configure DNS
Wait for SSL
Redis for Caching
Add Redis Service
Add Redis to Project
- Click New in your project
- Select Database → Redis
- Railway provisions Redis with:
- 100MB storage (Hobby plan)
- Private networking
- Auto-injected connection details
Configure LiteLLM
Enable Caching
Private Networking
Services can communicate using:Deployment Strategies
Continuous Deployment
Railway automatically deploys on Git push:- Detect the push via webhook
- Build Docker image
- Run health checks
- Deploy with zero downtime
Manual Deployment
- Go to service in Railway dashboard
- Click Deploy → Redeploy
- Or Trigger Deploy for specific commit
Rollback
View Deployments
Select Previous Version
Rollback
Monitoring and Observability
Railway Observability
Built-in monitoring includes:- Logs: Real-time log streaming
- Metrics: CPU, Memory, Network, Disk
- Deployments: Build and deploy history
- Events: Service lifecycle events
View Logs
Metrics Dashboard
Access in Metrics tab:- CPU usage: % utilization over time
- Memory usage: MB used / available
- Network: Inbound/outbound traffic
- Request count: Requests per second
External Monitoring
Add monitoring services:- Langfuse
- Datadog
- Sentry
Scaling
Vertical Scaling
Upgrade service resources:- Go to Settings → Resources
- Select plan:
- Hobby: 512MB RAM, 0.5 vCPU ($5/month)
- Pro: 8GB RAM, 8 vCPU ($20/month)
Horizontal Scaling
Pro plan features:- Multiple service instances
- Load balancing
- Zero-downtime deployments
- Vertical and horizontal scaling
Cost Management
Pricing Overview
Cost Optimization Tips
Use Shared Database
Remove Unused Services
Set Resource Limits
Use Sleep Mode