All tutorials

OpeNext CMS · Deployment

Deployment Walkthrough

Take OpeNext CMS from local development to production on Vercel, Railway, or a VPS with the right environment setup.

10 min readPublished 2026-06-20

Before you deploy

Make sure your local instance works end-to-end: tenants create successfully, pages publish, themes apply, and authentication flows work. Then prepare your production environment.

  • MongoDB Atlas cluster (or self-hosted MongoDB with auth enabled)
  • Strong JWT_SECRET (32+ random characters)
  • Domain name and HTTPS certificate
  • Environment variables documented

Production build

Verify the production build passes locally before deploying:

npm run build
npm run start

The production server runs on port 3011 by default. Test at http://localhost:3011 before pushing to your host.

Option A — Deploy to Vercel

  • Push your fork to GitHub
  • Import the project in Vercel and set the framework to Next.js
  • Add environment variables in the Vercel dashboard
  • Use MongoDB Atlas for MONGODB_URI (not a local connection string)
  • Deploy — Vercel runs npm run build automatically
# Required Vercel environment variables
MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net
JWT_SECRET=your-production-secret
NODE_ENV=production

Point your custom domain in Vercel settings and enable automatic HTTPS.

Option B — Deploy to Railway or Render

  • Connect your GitHub repository
  • Set build command: npm run build
  • Set start command: npm run start
  • Add the same environment variables as Vercel
  • Attach a managed MongoDB add-on or use Atlas

Both platforms support custom domains and automatic SSL. Railway is often faster to set up for full-stack apps with databases.

Option C — VPS with Docker

For full control, deploy on a VPS behind nginx:

# Build the image
docker build -t openext-cms .

# Run with environment variables
docker run -d \
  -p 3011:3011 \
  -e MONGODB_URI=mongodb+srv://... \
  -e JWT_SECRET=your-secret \
  -e NODE_ENV=production \
  --name openext \
  openext-cms

Put nginx in front with SSL via Let's Encrypt (Certbot):

server {
  listen 443 ssl;
  server_name cms.yourdomain.com;

  location / {
    proxy_pass http://localhost:3011;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
  }
}

Multi-tenant production checklist

  • MongoDB Atlas M10+ for production workloads with multiple tenants
  • Enable IP allowlisting or VPC peering for database access
  • Set up automated MongoDB backups
  • Monitor database count as you onboard tenants
  • Use connection pooling — Atlas handles this by default
  • Never commit .env files or secrets to version control

Post-deploy verification

  • Create a test tenant and confirm database isolation
  • Publish a page and verify public rendering
  • Test login/logout and RBAC role restrictions
  • Confirm theme changes apply on the public site
  • Check API endpoints respond with correct auth errors
  • Set up uptime monitoring (e.g. Better Uptime, UptimeRobot)

What's next?