Configuration
Mockzilla is configured with environment variables. This page covers the settings the server actually reads.
Environment Variables
Core Settings
| Variable | Description | Default |
|---|---|---|
PORT | Port the server listens on. | 36666 |
NODE_ENV | development or production. | development in Docker Compose |
DEPLOY_MODE | full serves the dashboard and APIs and redirects / to /app. landing serves only the marketing pages and docs; /app and /api return 404. | full |
NEXT_TELEMETRY_DISABLED | Set to 1 to disable Next.js telemetry. | 1 in Docker |
NODE_ORIGINS | Comma-separated hosts allowed to open the development server from another device, such as 192.168.1.10. | (none) |
Database
Mockzilla stores folders and mocks in PostgreSQL through Drizzle ORM.
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string. If it is not set, Mockzilla uses an embedded PGlite database instead. |
MOCKZILLA_DATA_DIR | Directory for PGlite data when DATABASE_URL is unset. Defaults to ./data (/app/data in the Docker image). |
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB | Used by the development docker-compose.yaml to create its PostgreSQL container. All default to mockzilla. |
To keep PGlite data between container restarts, mount a volume at /app/data:
docker run -p 36666:36666 -v mockzilla-data:/app/data andrecrjr/mockzilla:latest
Data Generation
| Variable | Description | Default |
|---|---|---|
MOCKZILLA_MAX_ITEMS | Upper limit for generated arrays. Arrays with no maxItems in their schema generate this many items. | 1000 |
Docker Compose example
# docker-compose.yaml snippet
services:
app:
environment:
- PORT=36666
- DATABASE_URL=postgresql://mockzilla:mockzilla@postgres:5432/mockzilla
ports:
- "36666:36666"
Advanced Settings
CORS
Every /api/* response, including served mocks and MCP, includes CORS headers.
Mockzilla echoes the request's Origin (or * when there is none), allows
credentials, and answers OPTIONS preflight requests directly. There is no origin
allow-list to configure, so put Mockzilla behind your own proxy if you need to
restrict access.
MCP (Model Context Protocol)
The MCP endpoint is /api/mcp, for example http://localhost:36666/api/mcp. It needs
no extra configuration. See AI Integration (MCP).
