Render offers a straightforward deployment experience with managed MongoDB and Redis. It's reliable, developer-friendly, and scales easily.

Why Render?

  • Native Docker support
  • Managed Redis included
  • Simple environment configuration
  • Automatic SSL certificates
  • Good free tier for testing

Prerequisites

  • A GitHub account
  • A Render account (sign up at render.com)
  • A MongoDB Atlas account (Render doesn't offer managed MongoDB)
  • Maillayer repository forked to your GitHub

Step 1: Set Up MongoDB Atlas

Since Render doesn't provide managed MongoDB, you'll use MongoDB Atlas (free tier available):

  1. Go to mongodb.com/atlas and create an account
  2. Create a new cluster (free M0 tier works fine)
  3. Click ConnectConnect your application
  4. Copy the connection string
  5. Replace <password> with your database user password

Step 2: Create a Redis Instance on Render

  1. Log into Render and click NewRedis
  2. Choose a name like maillayer-redis
  3. Select the Free plan for testing or Starter for production
  4. Click Create Redis
  5. Copy the Internal URL from the Redis dashboard

Step 3: Deploy Maillayer as a Web Service

  1. Click NewWeb Service
  2. Connect your GitHub and select the Maillayer repository
  3. Configure the service:
SettingValue
Namemaillayer
RuntimeDocker
Instance TypeStarter or higher

Step 4: Configure Environment Variables

In the Environment section, add these variables:

NODE_ENV=production
BASE_URL=https://maillayer.onrender.com
NEXTAUTH_SECRET=your-secret-key-minimum-32-characters
TRACKING_SECRET=your-tracking-secret
MONGODB_URI=mongodb+srv://user:password@cluster.mongodb.net/maillayer
REDIS_URL=<Internal Redis URL from Step 2>

Step 5: Deploy

  1. Click Create Web Service
  2. Render will build and deploy your application
  3. Wait 5-10 minutes for the initial build
  4. Access your app at https://your-service.onrender.com

Step 6: Add Custom Domain (Optional)

  1. Go to your service SettingsCustom Domains
  2. Add your domain and configure DNS as instructed
  3. Render automatically provisions SSL
  4. Update BASE_URL to your custom domain

Health Checks

Render performs automatic health checks. If your app becomes unresponsive, it restarts automatically. Configure health check path in Settings if needed.

Estimated Costs

ResourceFree TierProduction
Web ServiceLimited (spins down)$7/month (Starter)
RedisFree tier$10/month (Starter)
MongoDB AtlasFree M0$9/month (M2)

Total: Free tier available, ~$17-26/month for production.

Troubleshooting

Service keeps spinning down

  • Free tier services spin down after 15 minutes of inactivity. Upgrade to Starter plan for always-on.

Slow cold starts

  • First request after spin-down takes 30-60 seconds. Use a paid plan to avoid this.

MongoDB connection timeout

  • Ensure your MongoDB Atlas cluster allows connections from 0.0.0.0/0 (Network Access settings).

Workers crashing

  • Check logs in the Render dashboard. Verify Redis connection string is the internal URL.