DocsDeploymentRailway

Railway

Deploy Reqcore to Railway with managed PostgreSQL, S3-compatible storage, and automatic builds from GitHub.

Railway Deployment

Railway provides managed hosting for Reqcore with automatic builds from GitHub, managed PostgreSQL, and S3-compatible storage buckets.

Architecture on Railway

┌─────────────────────────────────────────────────────┐
│  Cloudflare CDN                                      │
│  • DNS (CNAME → Railway domain)                     │
│  • DDoS protection, edge caching                    │
│  • AI bot blocking                                  │
└─────────────────────┬───────────────────────────────┘
                      │ HTTPS
┌─────────────────────┼───────────────────────────────┐
│  Railway Project                                     │
│  ┌──────────────────▼───────────────────────────┐   │
│  │  Nuxt Service (auto-built from GitHub)        │   │
│  │  Build: npm run build                         │   │
│  │  Start: node .output/server/index.mjs         │   │
│  └──────────┬───────────────────┬───────────────┘   │
│             │                   │                    │
│  ┌──────────▼──────┐   ┌───────▼────────────────┐   │
│  │  PostgreSQL     │   │  Storage Bucket        │   │
│  │  (Railway DB)   │   │  (S3-compatible)       │   │
│  └─────────────────┘   └────────────────────────┘   │
└─────────────────────────────────────────────────────┘

Setup Steps

1. Create a Railway Project

  1. Sign in to Railway
  2. Click New ProjectDeploy from GitHub repo
  3. Select the reqcore-inc/reqcore repository (or your fork)

2. Add PostgreSQL

  1. In your Railway project, click NewDatabaseAdd PostgreSQL
  2. Railway automatically provisions the database and sets DATABASE_URL

3. Add Storage Bucket

  1. Click NewAdd Storage Bucket
  2. Railway provisions S3-compatible object storage

4. Configure Environment Variables

In the Nuxt service settings, add these variables:

VariableValue
DATABASE_URL${{Postgres.DATABASE_URL}}
S3_ENDPOINT${{Bucket.ENDPOINT}}
S3_ACCESS_KEY${{Bucket.ACCESS_KEY_ID}}
S3_SECRET_KEY${{Bucket.SECRET_ACCESS_KEY}}
S3_BUCKET${{Bucket.BUCKET}}
S3_REGION${{Bucket.REGION}}
S3_FORCE_PATH_STYLEfalse
BETTER_AUTH_SECRETGenerate a 32+ char random string
BETTER_AUTH_URLhttps://your-domain.com
NUXT_PUBLIC_SITE_URLhttps://your-domain.com

Template variables like ${{Postgres.DATABASE_URL}} auto-resolve to the actual values from linked Railway services.

5. Deploy

Push to your main branch — Railway auto-builds and deploys:

git push origin main

Railway detects the Nuxt app via package.json, runs npm run build, and starts with node .output/server/index.mjs.

Custom Domain with Cloudflare

  1. In Railway, go to your service SettingsNetworkingCustom Domain
  2. Add your domain (e.g., reqcore.com)
  3. In Cloudflare, create a CNAME record pointing to the Railway-provided domain
  4. Enable Full (strict) SSL mode in Cloudflare
  5. Update BETTER_AUTH_URL and NUXT_PUBLIC_SITE_URL to match your domain

Preview Deployments

Railway automatically creates preview deployments for pull requests. For PR environments:

  • Set BETTER_AUTH_URL to https://${{RAILWAY_PUBLIC_DOMAIN}} in your preview environment variables
  • Preview deployments get their own isolated database and storage

Monitoring

  • Railway provides built-in logs, metrics, and deployment history
  • Use railway logs CLI command for real-time log streaming
  • Database metrics are available in the PostgreSQL service panel

Next Steps