Getting Started
Install Domma CMS and have your site running in minutes

Installation

The fastest way to get started with Domma CMS is via the npx scaffolder. You will need Node.js 18+ and npm 7+ installed on your machine.

Prerequisites

  • Node.js 18 or higher — nodejs.org
  • npm 7 or higher (bundled with Node.js)
  • A terminal / command prompt

Create a new project

Run the following command, replacing my-site with your desired project name:

npx domma-cms my-site

This single command will:

  1. Scaffold a new Domma CMS project into the my-site/ directory
  2. Install all npm dependencies automatically
  3. Launch the interactive Setup Wizard to configure your site
  4. Start the development server once setup is complete

Specifying a directory name

Pass a project name to scaffold directly into a named directory:

npx domma-cms my-blog
npx domma-cms portfolio
npx domma-cms company-site

After installation, open your browser and navigate to http://localhost:4096 to see your new site, and http://localhost:4096/admin to access the admin panel.

Setup Wizard

The Setup Wizard runs automatically after npm install completes. It guides you through the essential configuration steps needed to get your site up and running.

What the wizard configures

Admin Account

You will be prompted to enter an email address and password for the initial administrator account. Passwords are hashed using bcrypt (12 rounds) before storage — your plaintext password is never persisted.

Site Identity

Set your site's title and tagline. These are saved to config/site.json and are available throughout your templates as {{site.title}} and {{site.tagline}}.

Theme Selection

Choose from 24 built-in Domma themes — 12 families, each with a dark and light variant:

charcoal-dark charcoal-light ocean-dark ocean-light forest-dark forest-light sunset-dark sunset-light royal-dark royal-light lemon-dark lemon-light silver-dark silver-light grayve-dark grayve-light mint-dark mint-light christmas-dark christmas-light unicorn-dark unicorn-light dreamy-dark dreamy-light

Security

A cryptographically random JWT_SECRET is generated automatically and written to your .env file. You do not need to set this manually.

Re-run the wizard at any time with npm run setup. Running setup again will prompt you to overwrite existing values or keep them.

Project Structure

A freshly scaffolded Domma CMS project has the following layout:

my-site/
├── admin/              # Domma SPA admin panel (read-only)
├── config/             # Site configuration files
│   ├── site.json       #   Global site settings (title, tagline, theme)
│   ├── navigation.json #   Primary navigation structure
│   └── plugins.json    #   Enabled plugins and their options
├── content/
│   └── pages/          # Markdown content files (one file per page)
├── media/              # Uploaded media files (images, PDFs, etc.)
├── plugins/            # Custom and third-party plugins
├── server/             # Fastify server internals (edit with care)
├── .env                # Environment variables (gitignored)
├── package.json
└── server.js           # Entry point — run this to start the server

Key directories explained

Directory / File Purpose Edit?
admin/ The Domma-powered SPA admin panel. Updated via npm. No
config/ JSON configuration for your site's structure and behaviour. Yes
content/pages/ Markdown files representing your site's pages and collections. Yes
media/ Static media uploaded via the admin panel. Managed
plugins/ Extend CMS functionality with custom or community plugins. Yes
server/ Fastify server internals, routing, and API handlers. Rarely
.env Secrets and environment-specific settings. Never commit this file. Yes

Requirements

Domma CMS is designed to run on any standard Node.js hosting environment. The core system has minimal requirements.

Dependency Version Required? Notes
Node.js 18+ Required LTS recommended
npm 7+ Required Bundled with Node.js 15+
pm2 Any Optional Recommended for production process management
MongoDB 6+ Optional Pro mode only — not required for file-based operation

Default port

Domma CMS listens on port 4096 by default. This can be changed by setting PORT in your .env file. For production deployments behind a reverse proxy (nginx, Caddy, etc.), it is recommended to keep the default internal port and expose only 80/443 externally.

File-Only Mode Default

Out of the box, Domma CMS operates in File-Only Mode — no database required. All content, collections, and form submissions are stored as flat files on disk.

What is stored where?

Data type Storage format Location
Pages Markdown with YAML front matter content/pages/
Collections JSON files content/collections/
Form submissions JSON files (one per submission) content/submissions/
Admin user JSON config/admin.json
Media Raw files media/

Is it right for your project?

File-Only Mode is an excellent choice for:

  • Blogs, documentation sites, and portfolios
  • Sites with up to approximately 10,000 pages
  • Teams that want their content version-controlled alongside code
  • Deployments to shared hosting or environments without a database
  • Rapid prototyping and proof-of-concept projects
Files in content/ are plain text and can be edited directly in your IDE, committed to Git, and deployed like any other source file.

Pro Mode MongoDB

For sites that require advanced querying, large-scale collections, or complex workflow automation, Pro Mode unlocks MongoDB-backed storage and additional capabilities.

Enabling Pro Mode

First, ensure MongoDB 6+ is running and accessible, then run:

npm run pro

The wizard will prompt for your MongoDB connection string and write it to .env:

MONGO_URI=mongodb://localhost:27017/domma-cms

What Pro Mode unlocks

Feature Description
Views Define reusable MongoDB aggregation pipelines via the admin panel — no code required
Actions Multi-step automated workflows triggered by content events (create, update, delete, schedule)
Row-Level Access Control Restrict read and write access to individual collection entries per user or role
MongoAdapter Collections transparently backed by MongoDB for high-volume, high-concurrency workloads
Full-Text Search Atlas Search or native MongoDB text indexes for content-wide search

Seed sample data

To populate your MongoDB instance with example content and collections:

npm run seed
Migration note: Switching from File-Only to Pro Mode does not automatically migrate existing content. Use npm run migrate (available in Pro Mode) to import your flat-file content into MongoDB.

npm Scripts

All common tasks are available as npm scripts. Run them from the root of your project directory.

Script Description
npm run dev Start the development server with hot reload. File changes are reflected immediately without a restart.
npm start Start the production server. No file watching or hot reload — optimised for stability.
npm run setup Re-run the interactive Setup Wizard. Prompts you to update or keep existing configuration values.
npm run seed Populate your site with sample pages, collections, and media to explore the CMS features.
npm run reset Destructive. Resets the site to factory defaults. All content and configuration will be deleted. Prompts for confirmation.
npm run pro Enable Pro Mode by configuring a MongoDB connection. Unlocks advanced features.
npm run backup Create a timestamped .tar.gz backup archive of your content, config, and media directories.

Environment Variables

Domma CMS uses a .env file in the project root to manage secrets and environment-specific settings. This file is automatically created by the Setup Wizard and is included in .gitignore by default.

Default .env contents

# ─── Server ───────────────────────────────────────────────────────────────────
PORT=4096                    # Port the server listens on (default: 4096)
NODE_ENV=production          # 'development' enables verbose logging and hot reload

# ─── Security ─────────────────────────────────────────────────────────────────
JWT_SECRET=<auto-generated>  # Secret key for signing JWTs — do not change after launch

# ─── Pro Mode (optional) ──────────────────────────────────────────────────────
MONGO_URI=                   # MongoDB connection string — leave blank for File-Only Mode

Variable reference

Variable Default Description
PORT 4096 The TCP port the Fastify server binds to. Change this if another service occupies port 4096.
NODE_ENV production Set to development for verbose error output, detailed logging, and hot reload.
JWT_SECRET Auto-generated A random 64-character secret used to sign and verify admin session tokens. Changing this after launch will invalidate all active sessions.
MONGO_URI empty MongoDB connection string. When empty, Domma CMS runs in File-Only Mode. Set via npm run pro.
Never commit your .env file to version control. It contains your JWT_SECRET and potentially your database credentials. The scaffolder adds .env to .gitignore automatically, but always double-check before pushing to a public repository.