Already have a server running? Skip to the Quick Start to
install the CLI and start managing content.
Prerequisites
You need Docker and Docker Compose installed. No other runtime (Bun, Node.js) is required for running the server.| Tool | Version | Install |
|---|---|---|
| Docker | 24+ | docs.docker.com/get-docker |
| Docker Compose | v2+ (included with Docker Desktop) | Bundled with Docker Desktop on macOS/Windows |
- macOS
- Linux
- Windows
bash brew install --cask docker Setup
Configure environment variables
Copy the example environment file and review it:The defaults work for local evaluation. For production, you should change database credentials, S3 keys, and configure auth providers. See the environment variables section below.
Start all services
- MDCMS Server on port
4000— the API backend - PostgreSQL 16 on port
5432— primary database - Redis 7 on port
6379— sessions and caching - MinIO on ports
9000/9001— S3-compatible object storage - Mailhog on ports
1025/8025— email capture (dev/staging)
Service Endpoints
| Service | URL | Purpose |
|---|---|---|
| MDCMS Server API | http://localhost:4000 | Backend API — all clients connect here |
| MinIO Console | http://localhost:9001 | Object storage admin (default: minioadmin/minioadmin) |
| Mailhog UI | http://localhost:8025 | Captured email viewer (auth flows, invites) |
| PostgreSQL | localhost:5432 | Direct database access |
| Redis | localhost:6379 | Direct cache access |
First Boot
After the server starts, you need to create your first user and connect the CLI.Create an admin user
Open the Studio UI from your host app (see Embed the Studio UI below), or use the CLI to authenticate:Connect the CLI
Initialize a project against your server:Embed the Studio UI
Add the visual content editor to your application. Install@mdcms/studio and mount it on a catch-all route in your app. See the Integration Guide for full step-by-step instructions covering Studio embedding, MDX components, authentication, and CORS setup.
Environment Variables
Required
These must be set for the server to start. The Docker Compose defaults handle these automatically for local use.| Variable | Description | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql://mdcms:mdcms@postgres:5432/mdcms |
REDIS_URL | Redis connection string | redis://redis:6379 |
S3_ENDPOINT | S3-compatible storage endpoint | http://minio:9000 |
S3_ACCESS_KEY | S3 access key | minioadmin |
S3_SECRET_KEY | S3 secret key | minioadmin |
S3_BUCKET | S3 bucket name | mdcms-media |
Server
| Variable | Description | Default |
|---|---|---|
PORT | Server listen port | 4000 |
NODE_ENV | Runtime environment | development |
LOG_LEVEL | Log verbosity (debug, info, warn, error) | info |
| Variable | Description | Default |
|---|---|---|
SMTP_HOST | SMTP server hostname | mailhog |
SMTP_PORT | SMTP server port | 1025 |
Studio
| Variable | Description | Default |
|---|---|---|
MDCMS_STUDIO_ALLOWED_ORIGINS | Comma-separated CORS origins for Studio embedding | — |
MDCMS_AUTH_INSECURE_COOKIES | Allow HTTP cookies (set true for local dev without HTTPS) | false |
Auth Providers (optional)
Configure SSO providers for your organization. Providers are enabled by presence — no feature flag is needed.| Variable | Description |
|---|---|
MDCMS_AUTH_OIDC_PROVIDERS | JSON array of OIDC provider configurations |
MDCMS_AUTH_SAML_PROVIDERS | JSON array of SAML provider configurations |
MDCMS_AUTH_ADMIN_EMAILS | Comma-separated emails that get admin role on first login |
Example OIDC provider config
Example OIDC provider config
Example SAML provider config
Example SAML provider config
Production Considerations
Security
- Set strong, unique values for
S3_ACCESS_KEY,S3_SECRET_KEY, and database credentials - Configure
MDCMS_STUDIO_ALLOWED_ORIGINSto restrict CORS to your actual Studio host domain - Set
NODE_ENV=productionto enable secure cookie defaults and disable development features - Remove
MDCMS_AUTH_INSECURE_COOKIES(or set tofalse) when running behind HTTPS - Replace Mailhog with a production SMTP provider
Persistence
The Docker Compose configuration uses named volumes (pgdata, miniodata) for PostgreSQL and MinIO. These persist across container restarts. To back up your data:
Upgrading
To upgrade to a newer version of MDCMS:Using an External Database
To use an existing PostgreSQL instance instead of the bundled container, setDATABASE_URL to your external connection string and remove the postgres service from docker-compose.yml. The same applies to Redis (REDIS_URL) and S3-compatible storage (S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY).
Stopping and Resetting
Next Steps
Quick Start
Install the CLI, define your schema, and start managing content
CLI Commands
Push, pull, login, schema sync, and all CLI flags
Studio Guide
Embed the visual content editor in your application
API Reference
REST API endpoints, authentication, and the TypeScript SDK