Deploy to Railway
Railway is a modern deployment platform that makes it easy to deploy Umami with PostgreSQL in minutes. No Docker knowledge required.What is Railway?
Railway is a deployment platform that provisions infrastructure, automatically deploys your code, and handles scaling. Perfect for hosting Umami with minimal configuration.
- One-click deployment
- Automatic PostgreSQL provisioning
- Free tier available (with limits)
- Automatic HTTPS
- Custom domains
- Environment variable management
- Automatic deploys from Git
Quick Deploy
The fastest way to deploy Umami to Railway:Create Railway Account
Sign up at railway.app using:
- GitHub account (recommended)
- Email and password
Fork the Repository (Optional)
If you want to customize Umami or enable automatic deployments:
- Go to github.com/umami-software/umami
- Click Fork in the top right
- This creates a copy in your GitHub account
Deploy to Railway
- From Template
- Manual Setup
Click the deploy button (if available in Umami’s README) or:
- Go to Railway dashboard
- Click New Project
- Select Deploy from GitHub repo
- Choose
umami-software/umamior your fork - Click Deploy Now
Add PostgreSQL Database
If not already added:
- In your project, click + New
- Select Database
- Choose PostgreSQL
- Railway automatically creates the database
Railway automatically sets the
DATABASE_URL environment variable connecting your app to the database.Configure Environment Variables
Add required environment variables:Generate a random secret:
- Click on your Umami service
- Go to Variables tab
- Add the following:
Deploy
Railway automatically deploys when you:
- Push changes to your GitHub repository
- Add a service or database
- Change environment variables
Get Your URL
Once deployed:
- Click on your Umami service
- Go to Settings tab
- Find Domains section
- Railway provides a free domain:
your-app.up.railway.app - Click Generate Domain if not already created
https://your-app.up.railway.appCustom Domain Setup
Add your own domain to Railway:Add Domain in Railway
- Go to your Umami service
- Click Settings tab
- Scroll to Domains
- Click + Custom Domain
- Enter your domain (e.g.,
analytics.yourdomain.com)
Configure DNS
Railway will show you DNS records to add:
- CNAME Record
- A Record (Alternative)
Add a CNAME record in your domain registrar:
Wait for DNS Propagation
DNS changes can take 5 minutes to 48 hours to propagate globally.Check status:
Environment Variables
Configurable options for Railway deployment:Required Variables
Required Variables
- APP_SECRET: Random string for encrypting sessions (required)
- DATABASE_URL: Automatically set by Railway PostgreSQL
Optional Variables
Optional Variables
Advanced Options
Advanced Options
See the full list in Environment Variables.
Database Management
Access Railway PostgreSQL
Connect to your Railway PostgreSQL database:- Railway CLI
- External Client
Install Railway CLI:Login and connect:
Backup Database
Scaling and Resources
Monitor Usage
Railway provides resource monitoring:- Go to your service
- Check Metrics tab for:
- CPU usage
- Memory usage
- Network traffic
- Deployment history
Upgrade Resources
Railway’s free tier includes:
- 500 hours of usage per month
- $5 credit
- Shared CPU and memory
- Unlimited usage
- Better performance
- More databases
- Priority support
- Click on your workspace name
- Go to Billing
- Choose a plan
Deployment Settings
Configure Build Settings
- Click on Umami service
- Go to Settings
- Adjust:
Build Command
Build Command
Railway auto-detects the build command from This is configured in the Umami repository.
package.json:Start Command
Start Command
Railway runs:This starts Umami in production mode.
Healthcheck
Healthcheck
Railway monitors:Returns 200 OK when Umami is healthy.
Auto-Deploy from GitHub
Enable automatic deployments:- Connect your GitHub account
- Fork the Umami repository
- Link it to Railway
- Railway deploys on every push to main branch
Troubleshooting
Deployment failed
Deployment failed
Check deployment logs:
- Click on your service
- Go to Deployments tab
- Click on failed deployment
- View logs for errors
- Missing APP_SECRET
- Database connection failed
- Build errors
- Out of memory
Database connection error
Database connection error
Verify PostgreSQL is running:
- Click on PostgreSQL service
- Check status is “Active”
- Verify DATABASE_URL is set in Umami service
- Firewall allows Railway IPs
- Credentials are correct
- Database is accessible
App is slow or crashes
App is slow or crashes
Check resource usage:
- View Metrics tab
- Look for CPU/memory spikes
- Upgrade plan if consistently high
- Use ClickHouse for high-volume sites
- Enable caching
- Optimize database queries
Custom domain not working
Custom domain not working
Verify DNS configuration:Check:
- DNS records point to Railway
- SSL certificate provisioned (can take a few minutes)
- No conflicting DNS records
- Wait for DNS propagation (up to 48 hours)
Updating Umami
Update to the latest version:- Automatic (GitHub)
- Manual Redeploy
If you connected via GitHub:
-
Sync your fork with upstream:
- Railway auto-deploys the update
Database migrations run automatically during deployment.
Cost Optimization
Estimated costs:- Free tier: $0 (with limits)
- Hobby: $5/month
- Pro: $20/month (unlimited usage)
Next Steps
Add Your Website
Start tracking your first website
Custom Domain
Set up your own domain for Umami
Environment Variables
Configure advanced features
Database Backups
Set up automated backups