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
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
- Log into Railway and click New Project
- Select Deploy from GitHub repo
- Choose your forked Maillayer repository
Step 2: Add MongoDB Database
- In your project, click New → Database → Add MongoDB
- Railway will provision a MongoDB instance
Step 3: Add Redis Database
- Click New → Database → Add Redis
- 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
- Railway auto-deploys when you push to your main branch
- Click Deploy to trigger a manual deployment
- Wait 3-5 minutes for the build to complete
- Click the generated URL to access your Maillayer instance
Post-Deployment
- Open your Railway app URL
- Enter your license key to activate Maillayer
- Create your admin account
- Start sending emails!
Add Custom Domain (Optional)
- Go to Settings → Domains
- Click Generate Domain for a free
*.up.railway.appsubdomain - Or click Custom Domain and add your own domain
- Update your
BASE_URLenvironment 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
| Resource | Free Tier | Paid |
|---|---|---|
| Compute | $5 credit/month | ~$5-10/month |
| MongoDB | Included | ~$5-7/month |
| Redis | Included | ~$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_URIandREDIS_URLare correctly set.
Can't connect to database
- Verify you're using Railway's reference variables (
${{MongoDB.MONGO_URL}}).
