Skip to content

Railway

Railway provides easy deployment with automatic builds from Git.

  1. Push your code to GitHub
  2. Connect Railway to your repository
  3. Railway auto-detects Node.js and deploys

Create railway.json:

{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "pnpm prisma migrate deploy && node dist/index.js",
"healthcheckPath": "/api/health",
"healthcheckTimeout": 30
}
}

Set in Railway dashboard:

NODE_ENV=production
DATABASE_URL=${{Postgres.DATABASE_URL}}
JWT_SECRET=your-secret
JWT_REFRESH_SECRET=your-refresh-secret
  1. Click “New Service” in Railway
  2. Select “Database” → “PostgreSQL”
  3. Railway auto-links DATABASE_URL
  1. Go to Settings → Domains
  2. Add your custom domain
  3. Update DNS with provided CNAME