Skip to main content
This guide walks you through setting up a local MDCMS development environment from scratch for contributing to MDCMS itself. By the end, you will have all services running and be ready to develop.
If you want to use MDCMS in your own project (not contribute to the MDCMS codebase), see the Quick Start instead.

Prerequisites

Before you begin, install the following tools:
ToolVersionPurpose
Bun1.3.11+ (pinned in .bun-version)Package manager, runtime, and test runner
Docker & Docker ComposeLatest stableInfrastructure services (PostgreSQL, Redis, MinIO)
Node.js20+Required for Next.js apps (studio-example, studio-review)
GitLatest stableSource control
# Install Bun
brew install oven-sh/bun/bun

# Install Docker Desktop (includes Docker Compose)
brew install --cask docker

# Install Node.js via nvm
brew install nvm
nvm install 20
The repository includes a .bun-version file that pins Bun to 1.3.11. If you use a version manager like mise or proto, it will pick this up automatically.

Clone & Install

1

Clone the repository

bash git clone git@github.com:Blazity/mdcms.git && cd mdcms
2

Install dependencies

bash bun install This also sets up the pre-push git hook that runs CI checks before every push.
3

Copy environment file

bash cp .env.example .env Edit .env to override any defaults for your local setup. See the environment variables section below.

Environment Variables

Required

These must be set for the server to start.
VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://postgres:postgres@localhost:5432/mdcms
REDIS_URLRedis connection stringredis://localhost:6379
S3_ENDPOINTS3-compatible storage endpointhttp://localhost:9000
S3_ACCESS_KEYS3 access keyminioadmin
S3_SECRET_KEYS3 secret keyminioadmin
S3_BUCKETS3 bucket namemdcms

Server

VariableDescriptionExample
PORTServer listen port4000
NODE_ENVRuntime environmentdevelopment
LOG_LEVELLog verbosity (debug, info, warn, error)debug

Studio

VariableDescriptionExample
MDCMS_STUDIO_ALLOWED_ORIGINSCORS allowed origins for Studiohttp://localhost:4173
MDCMS_AUTH_INSECURE_COOKIESAllow HTTP cookies in dev (no HTTPS)true

Auth Providers (optional)

VariableDescriptionExample
MDCMS_AUTH_OIDC_PROVIDERSOIDC provider configuration (JSON)
MDCMS_AUTH_SAML_PROVIDERSSAML provider configuration (JSON)

Demo

VariableDescriptionExample
MDCMS_DEMO_API_KEYAPI key for demo seed datamdcms_key_demo_local_compose_seed_2026_read
MDCMS_DEMO_PROJECTDemo project slugmarketing-site
MDCMS_DEMO_ENVIRONMENTDemo environment namestaging
The Docker Compose dev configuration sets all required variables automatically. You only need to configure .env manually if running services outside Docker.

Start Development

Service Endpoints

Once running, these services are available:
ServiceURL
Server APIhttp://localhost:4000
Studio Examplehttp://localhost:4173
Studio Reviewhttp://localhost:3000
MinIO Consolehttp://localhost:9001
Mailhoghttp://localhost:8025
PostgreSQLlocalhost:5432
Redislocalhost:6379

Demo Credentials

The dev seed data creates a demo user you can use to log in to Studio:
FieldValue
Emaildemo@mdcms.local
PasswordDemo12345!

Available Commands

These scripts are defined in the root package.json and orchestrated by Nx:
CommandDescription
bun run devStart the server in development mode
bun run compose:devStart full dev stack via Docker Compose
bun run compose:dev:downStop the dev Docker Compose stack
bun run buildBuild all packages and apps
bun run typecheckRun TypeScript type checking across all packages
bun run qualityRun format check + typecheck
bun run unitRun unit tests
bun run integrationRun integration tests (requires Docker services)
bun run ci:requiredRun the full CI gate: format + typecheck + unit + integration
bun run formatFormat code with Prettier