InboxorcistInboxorcist

Railway

Deploy Inboxorcist to Railway with one click.

Railway offers simple deployment with a generous free tier. Perfect for getting started quickly.

One-Click Deploy

Deploy on Railway

Steps

  1. Click the deploy button above
  2. Sign in with your GitHub account
  3. Configure the required environment variables:
    • JWT_SECRET — Must be at least 32 characters. Generate with: openssl rand -base64 32
    • ENCRYPTION_KEY — Must be a 64-character hex string. Generate with: openssl rand -hex 32
  4. Click Deploy

Railway automatically provisions a PostgreSQL database and connects it via DATABASE_URL.

After Deployment

  1. Open your app URL (shown in Railway dashboard)
  2. Go to /setup to configure Google OAuth credentials
  3. Connect your Gmail and start cleaning!

Manual Deployment

Step 1: Create a New Project

  1. Log in to Railway
  2. Click New Project
  3. Select Deploy from GitHub repo
  4. Connect your GitHub account and select the Inboxorcist repository

Step 2: Configure Build Settings

Railway auto-detects the Dockerfile. Verify settings:

  • Builder: Dockerfile
  • Dockerfile Path: Dockerfile
  • Watch Paths: Leave default

Step 3: Set Environment Variables

Go to Variables and add:

# Required - Security (generate these)
JWT_SECRET=your-jwt-secret-min-32-chars
ENCRYPTION_KEY=your-64-character-hex-encryption-key

# App URL (your Railway domain)
APP_URL=https://your-app.up.railway.app

# Optional - Google OAuth (can also be configured via /setup UI)
# GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
# GOOGLE_CLIENT_SECRET=GOCSPX-your-secret

Generate secrets:

# JWT_SECRET
openssl rand -base64 32

# ENCRYPTION_KEY
openssl rand -hex 32

Google OAuth credentials are optional. You can configure them via the web UI at /setup after deployment.

Step 4: Deploy

Click Deploy or push to your repository. Railway will build and deploy automatically.

Step 5: Configure Google OAuth

After deployment, configure Google OAuth either:

  • Via the web UI at https://your-app.up.railway.app/setup, or
  • By adding GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to your Railway variables

If using the Google Cloud Console, add your Railway URL to Authorized redirect URIs:

https://your-app.up.railway.app/auth/google/callback

Database Options

Railway provides managed PostgreSQL databases:

  1. In your Railway project, click New
  2. Select Database > Add PostgreSQL
  3. Railway automatically sets DATABASE_URL in your service

Option B: External PostgreSQL

If you have an existing PostgreSQL database (e.g., Supabase, Neon, or your own):

  1. Go to Variables in your Railway service
  2. Add DATABASE_URL with your connection string:
    postgres://user:password@host:5432/dbname

Option C: SQLite (Default)

If no DATABASE_URL is set, Inboxorcist uses SQLite automatically. Data is stored in the container's /usr/src/app/data directory.

SQLite data may not persist across Railway deployments. For production, use Railway's managed PostgreSQL.

Custom Domain

  1. Go to Settings > Domains
  2. Click Generate Domain or Add Custom Domain
  3. Update environment variables and Google OAuth redirect URI accordingly

Monitoring

View Logs

Click on your service and select Deployments to view build and runtime logs.

Check Metrics

Railway provides CPU, memory, and network metrics in the Metrics tab.

Updating

Railway automatically deploys when you push to the connected branch. To manually redeploy:

  1. Go to Deployments
  2. Click Redeploy

Pricing

Railway offers a free tier with:

  • $5 of usage credits per month
  • 500 hours of execution time

For larger mailboxes or persistent databases, consider their paid plans.

Troubleshooting

Build Fails

Check build logs in the Deployments tab. Common issues:

  • Missing Dockerfile at specified path
  • Network issues pulling base images

App Crashes on Start

Check runtime logs for environment variable validation errors:

  • Ensure all required variables are set
  • Verify JWT_SECRET is at least 32 characters
  • Verify ENCRYPTION_KEY is exactly 64 hex characters

OAuth Errors

Ensure your Google Cloud Console redirect URI matches ${APP_URL}/auth/google/callback:

  • Must use https:// (Railway provides HTTPS automatically)
  • Must match exactly: https://your-app.up.railway.app/auth/google/callback

On this page