Quickest Way to Deploy
The fastest way to get n8n running in production is through Railway. It handles all the infrastructure complexity and gets you running in just 2 minutes.Why Railway?
Railway is the recommended deployment method because it provides:- One-click deployment - No configuration needed
- Automatic SSL - HTTPS out of the box
- Managed databases - PostgreSQL and Redis included
- Auto-scaling - Handles traffic spikes
- Built-in monitoring - See logs and metrics
- Easy updates - Redeploy with one click
Railway Setup Steps
Prerequisites
- Sign up for Railway at railway.com
- GitHub account for authentication
Step-by-Step Deployment
-
Click Deploy Button
- Use the deploy button above
- Or visit railway.com/new/template/n8n-with-workers
-
Authorize Railway
- Sign in with GitHub
- Authorize Railway to create repositories
-
Deploy Template
- Click “Deploy” on the n8n template
- Railway automatically provisions:
- Redis for queues
- PostgreSQL for data
- n8n primary instance
- n8n worker instances
-
Access Your Instance
- Go to Railway dashboard
- Click on “Primary” service
- Navigate to Settings → Network
- Click “Generate Domain”
- Access your n8n at the provided URL
-
Set Admin Credentials
- In Railway dashboard, go to Variables
- Set these environment variables:
- Redeploy for changes to take effect
Alternative: Docker Compose
If you prefer more control over your deployment, use Docker Compose:Post-Deployment Setup
Configure Webhook URL
After deployment, configure your webhook URL:- In Railway or your deployment environment
- Set the
WEBHOOK_URL
environment variable - Use your public domain:
https://your-domain.railway.app/
Enable Execution Pruning
Keep your database clean:Set Timezone
Configure your timezone:Monitoring Your Instance
Railway Monitoring
Railway provides built-in monitoring:- Logs - Real-time application logs
- Metrics - CPU, memory, and network usage
- Deployments - Track deployment history
- Alerts - Set up notifications
Health Checks
Check if your instance is running:Scaling Your Deployment
Adding More Workers
In Railway, scale workers by:- Go to your project settings
- Find the n8n-worker service
- Increase replica count
- Railway handles load balancing
Database Optimization
For better performance:Troubleshooting
Common Issues
Issue | Solution |
---|---|
Can’t access n8n | Check if domain is generated in Railway |
Webhooks not working | Ensure WEBHOOK_URL is set correctly |
High memory usage | Enable execution pruning |
Authentication not working | Check N8N_BASIC_AUTH variables |