Railway is the simplest option for deploying Maillayer. It handles databases, environment variables, and deployments in one place—no server management required.

Note: You'll need a Maillayer license key to activate your installation. Get your license if you haven't already.

One-Click Deploy

Deploy on Railway

This template automatically provisions:

  • Maillayer application
  • MongoDB database
  • Redis cache

Why Railway?

  • One-click MongoDB and Redis setup
  • Auto-deploys from GitHub
  • Built-in logging and monitoring
  • No Docker or server knowledge needed
  • Generous free tier to get started

Manual Setup

If you prefer to set up manually:

Step 1: Create a New Project

  1. Log into Railway and click New Project
  2. Select Deploy from GitHub repo
  3. Choose your forked Maillayer repository

Step 2: Add MongoDB Database

  1. In your project, click NewDatabaseAdd MongoDB
  2. Railway will provision a MongoDB instance

Step 3: Add Redis Database

  1. Click NewDatabaseAdd Redis
  2. Railway will provision a Redis instance

Step 4: Configure Environment Variables

Click on your Maillayer service, go to Variables, and add:

NODE_ENV=production
BASE_URL=https://your-app.up.railway.app
NEXTAUTH_SECRET=your-secret-key-minimum-32-characters
TRACKING_SECRET=your-tracking-secret
MONGODB_URI=${{MongoDB.MONGO_URL}}
REDIS_URL=${{Redis.REDIS_URL}}

Railway's reference variables (${{MongoDB.MONGO_URL}}) automatically link to your database services.

Step 5: Deploy

  1. Railway auto-deploys when you push to your main branch
  2. Click Deploy to trigger a manual deployment
  3. Wait 3-5 minutes for the build to complete
  4. Click the generated URL to access your Maillayer instance

Post-Deployment

  1. Open your Railway app URL
  2. Enter your license key to activate Maillayer
  3. Create your admin account
  4. Start sending emails!

Add Custom Domain (Optional)

  1. Go to SettingsDomains
  2. Click Generate Domain for a free *.up.railway.app subdomain
  3. Or click Custom Domain and add your own domain
  4. Update your BASE_URL environment variable to match

Monitoring & Logs

  • View real-time logs in the Deployments tab
  • Monitor resource usage in the Metrics tab
  • Railway restarts crashed services automatically

Estimated Costs

ResourceFree TierPaid
Compute$5 credit/month~$5-10/month
MongoDBIncluded~$5-7/month
RedisIncluded~$3-5/month

Total: Free to start, ~$13-22/month for production workloads.

Troubleshooting

Build fails with memory error

  • Railway's free tier has limited memory. Upgrade to a paid plan or reduce build concurrency.

Workers not starting

  • Check logs for connection errors. Ensure MONGODB_URI and REDIS_URL are correctly set.

Can't connect to database

  • Verify you're using Railway's reference variables (${{MongoDB.MONGO_URL}}).