All tutorials

OpeNext CMS · Getting Started

Build a Multi-Tenant CMS in 30 Minutes

Clone OpeNext CMS, configure MongoDB, create your first tenant, and publish a themed page — step by step.

12 min readPublished 2026-06-01

What you'll build

By the end of this tutorial you'll have OpeNext CMS running locally with MongoDB, a tenant created, a themed homepage built with blocks, and a clear mental model of how multi-tenancy works.

  • A running OpeNext CMS instance on localhost:3011
  • One tenant with its own isolated database
  • A published page using the page builder
  • A customized theme applied to the tenant

Prerequisites

  • Node.js 20+ installed
  • MongoDB running locally or a MongoDB Atlas connection string
  • Git and a terminal
  • About 30 minutes

Step 1 — Clone and install (5 min)

Clone the repository and install dependencies:

git clone https://github.com/OpenNextCMS/openext.git
cd openext
npm install

Step 2 — Configure environment (5 min)

Copy the example environment file and set your MongoDB connection:

cp .env.example .env

Add these required values to .env:

MONGODB_URI=mongodb://localhost:27017/openext
JWT_SECRET=your-strong-random-secret-here

For MongoDB Atlas, use your cluster connection string. Each tenant will get its own database automatically — you don't need to create them manually.

Step 3 — Start the dev server (2 min)

npm run dev

Open http://localhost:3011 in your browser. You should see the CMS dashboard or onboarding flow.

Step 4 — Create your first tenant (5 min)

In the dashboard, create a new tenant. Each tenant is a separate site with its own:

  • MongoDB database (fully isolated from other tenants)
  • Pages and block content
  • Theme configuration
  • User roles (Owner, Admin, Editor, Viewer)

On first access, the tenant database is auto-seeded with default roles, settings, and five system themes (Startup, Agency, Corporate, Ecommerce, Portfolio).

Step 5 — Build a page with blocks (8 min)

Open the page builder and create a new homepage:

  • Add a Hero block with your headline and CTA
  • Add a Row with two Columns for feature highlights
  • Drop in Card blocks for each feature
  • Add a Navbar block for site navigation

Blocks are composable — rows contain columns, columns contain content blocks. Preview your page before publishing.

Step 6 — Customize the theme (5 min)

Open the Theme Builder and pick a system preset or customize tokens:

  • Colors — primary, secondary, background, text
  • Typography — font families and scale
  • Spacing and border radius
  • Component variants for buttons and cards

Save and preview — changes apply to all public pages for this tenant instantly.

What's next?

You now have a working multi-tenant CMS. Here's where to go from here:

  • Add more tenants for additional sites or clients
  • Invite team members with appropriate RBAC roles
  • Explore the REST API for headless integrations
  • Read the deployment walkthrough to go to production

Multi-tenant architecture docs →