Deploy to Railway
Railway handles infrastructure so you can focus on collecting feedback. One click gives you Quackback, PostgreSQL, and Redis with automatic SSL, deployments on push, and no server management.
Prerequisites
- A Railway account (free tier available)
- A domain or subdomain for your instance (e.g.,
feedback.yourcompany.com)
One-Click Deploy
Click the button below to deploy Quackback to Railway:
The template provisions three services:
| Service | Purpose |
|---|---|
| Quackback | The application server |
| PostgreSQL | Database with pgvector extension |
| Redis | Background job queue (BullMQ) |
Manual Setup
If you prefer to configure each service yourself:
1. Create a New Project
- Go to railway.app/new
- Click Empty Project
2. Add PostgreSQL
- Click + New → Database → PostgreSQL
- Railway provisions a PostgreSQL instance automatically
Quackback requires the pgvector extension. Railway's PostgreSQL supports it. Run CREATE EXTENSION IF NOT EXISTS vector; via the Railway console if migrations don't create it automatically.
3. Add Redis
- Click + New → Database → Redis
- Railway provisions a Redis instance automatically
4. Deploy Quackback
- Click + New → GitHub Repo
- Connect the
quackbackio/quackbackrepository (or your fork) - Railway detects the Dockerfile and builds automatically
5. Configure Environment Variables
In the Quackback service settings, add these variables:
# Railway injects DATABASE_URL and REDIS_URL automatically if you link the services.
# If not linked, set them manually:
DATABASE_URL=${{Postgres.DATABASE_URL}}
REDIS_URL=${{Redis.REDIS_URL}}
# Authentication (generate with: openssl rand -base64 32)
SECRET_KEY="your-32-character-minimum-secret-key"
# Public URL (set after assigning a domain)
BASE_URL="https://feedback.yourcompany.com"6. Link Services
- Go to the Quackback service → Variables
- Click Add Reference to link
DATABASE_URLfrom the PostgreSQL service - Click Add Reference to link
REDIS_URLfrom the Redis service
7. Add a Domain
- Go to the Quackback service → Settings → Networking
- Click Generate Domain for a Railway subdomain, or Custom Domain for your own
- If using a custom domain, add a CNAME record pointing to Railway
- Update
BASE_URLto match
Railway provides automatic SSL for all domains. No certificate configuration needed.
Email Configuration
Without email, OTP codes are printed to Railway logs. For production, configure SMTP or Resend:
# SMTP
EMAIL_SMTP_HOST="smtp.example.com"
EMAIL_SMTP_PORT="587"
EMAIL_SMTP_USER="your-username"
EMAIL_SMTP_PASS="your-password"
EMAIL_FROM="feedback@yourcompany.com"
# Or Resend
EMAIL_RESEND_API_KEY="re_xxxxxxxxxxxx"
EMAIL_FROM="feedback@yourcompany.com"File Storage
For image uploads, configure S3-compatible storage:
S3_ENDPOINT="https://your-s3-endpoint"
S3_BUCKET="quackback-uploads"
S3_ACCESS_KEY="your-access-key"
S3_SECRET_KEY="your-secret-key"
S3_REGION="us-east-1"Railway doesn't provide persistent file storage. Use an external S3-compatible service like AWS S3, Cloudflare R2, or Backblaze B2 for file uploads.
Upgrades
Railway rebuilds and redeploys automatically when you push to the connected branch. Migrations run on every startup, so schema changes are applied automatically.
To upgrade a template deployment:
- Fork the Quackback repository if you haven't already
- Pull the latest changes from upstream
- Push to your fork — Railway redeploys automatically
Monitoring
Logs
View real-time logs in the Railway dashboard:
- Go to your Quackback service
- Click Deployments → select the active deployment
- Click View Logs
Health Check
Railway can restart the service if it becomes unhealthy:
- Go to Settings → Deploy
- Set the health check path to
/api/health
Cost
Railway bills based on usage. A typical Quackback instance costs $5–20/month depending on traffic:
| Resource | Estimate |
|---|---|
| Quackback (512 MB RAM) | ~$5/mo |
| PostgreSQL | ~$5/mo |
| Redis | ~$2/mo |
Railway's free trial includes $5 of usage. After that, the Hobby plan starts at $5/month with $5 of included usage.
Troubleshooting
Build Fails
Check the build logs for errors. Common causes:
- Missing environment variables — ensure
DATABASE_URLandSECRET_KEYare set - Docker build issues — Railway uses the repository's Dockerfile
Database Connection Failed
- Verify the PostgreSQL service is running
- Check that
DATABASE_URLreferences the correct service - Try restarting the Quackback service
"Port Already in Use"
Railway assigns a port via the PORT environment variable. Quackback reads this automatically. Do not hardcode a port.
Next Steps
- Configuration Reference - All environment variables
- Reverse Proxy - Custom proxy configurations
- Docker Deployment - Alternative deployment with Docker