A powerful self-hosted API mocking platform for development and testing. Deploy your own private mock server with an intuitive interface and advanced response generation capabilities.
Perfect for quick testing and development. By default, all data is stored in memory and will be lost when the container stops. Use volume persistence to maintain data between restarts.
# Pull the latest image
docker pull andrecrjr/mockzilla:latest
# run with volume persistence to maintain data between container restarts
docker run -p 36666:36666 \
-v mockzilla-data:/data \
andrecrjr/mockzilla:latestTip
This option is ideal for development, testing, and quick experimentation. It starts instantly with no external dependencies. Use volume persistence to keep your mocks between container restarts.
Your mock server will be available at http://localhost:36666
For production use or when you need data persistence between container restarts.
# Pull the latest image
docker pull andrecrjr/mockzilla:latest
# Run with external PostgreSQL database
docker run -p 36666:36666 \
-e DATABASE_URL=postgresql://username:password@host:5432/database_name \
andrecrjr/mockzilla:latestNote
This option is recommended for production environments where data persistence is required. Make sure your PostgreSQL database is accessible from the container.
Your mock server will be available at http://localhost:36666
bun run dev- Start development server on port 36666bun run build- Build for productionbun run start- Start production serverbun run lint- Run ESLint
bun run db:generate- Generate database migrationsbun run db:migrate- Run database migrationsbun run db:push- Push schema changes to databasebun run db:studio- Open Drizzle Studio (database UI)
docker pull andrecrjr/mockzilla:latest- Pull latest imagedocker run -p 36666:36666 andrecrjr/mockzilla:latest- Run with PGLite (in-memory)docker run -p 36666:36666 -e DATABASE_URL=... andrecrjr/mockzilla:latest- Run with PostgreSQL
docker run -d \
--name mockzilla \
-p 36666:36666 \
andrecrjr/mockzilla:latestdocker run -d \
--name mockzilla \
-p 36666:36666 \
-v mockzilla-data:/data \
andrecrjr/mockzilla:latestFor development purposes, the project includes Makefile commands:
make dev-up- Start development environment with hot-reloadmake dev-down- Stop development environmentmake dev-logs- View logsmake db-studio- Open Drizzle Studio in Dockermake help- See all available development commands
Note
Makefile commands are primarily for development and contributing to the project, not for production self-hosting.
Mockzilla is designed for easy self-hosting with the following technologies:
- Framework: Next.js 16 with App Router (for mock server UI)
- Runtime: Bun (fast JavaScript runtime)
- Language: TypeScript
- Database: PostgreSQL with Drizzle ORM (for mock configuration storage)
- Styling: Tailwind CSS 4
- UI Components: Radix UI
- Forms: React Hook Form + Zod
- Containerization: Docker (for simplified self-hosting)
Mockzilla provides optimized Docker images for reliable self-hosting:
- Docker Hub Image:
andrecrjr/mockzilla:latest- Production-ready image - In-Memory Option: Uses PGLite for fast, ephemeral storage
- Persistent Option: Connects to external PostgreSQL for data persistence
Always start by pulling the latest image:
docker pull andrecrjr/mockzilla:latestFor production use, connect to an external PostgreSQL database:
docker run -d \
--name mockzilla \
-p 36666:36666 \
-e DATABASE_URL=postgresql://username:password@host:5432/database_name \
andrecrjr/mockzilla:latestTo persist data without an external database, mount a volume to /data/:
docker run -d \
--name mockzilla \
-p 36666:36666 \
-v mockzilla-data:/data \
andrecrjr/mockzilla:latestOr mount a local directory:
docker run -d \
--name mockzilla \
-p 36666:36666 \
-v /path/to/local/data:/data \
andrecrjr/mockzilla:latestNote
Using volume persistence at /data/ will maintain your mocks and configurations between container restarts while still using the in-memory PGLite database.
DATABASE_URL(optional): PostgreSQL connection string (when using external database)PORT(optional): Port to run the server on (default: 36666)
- Volume mount: Mount a volume to
/data/to persist mocks and configurations between container restarts when using PGLite
mockzilla/
βββ app/ # Next.js app directory (mock server UI)
βββ components/ # React components (UI elements)
βββ lib/ # Utility functions and configurations
β βββ db/ # Database schema and connection (for mock storage)
βββ drizzle/ # Database migrations (for self-hosted database)
βββ public/ # Static assets
βββ Dockerfile # Development Docker configuration (for local self-hosting)
βββ Dockerfile.dev # Development Docker configuration (legacy)
βββ Dockerfile.prd # Production Docker configuration (for production self-hosting)
βββ docker-compose.yaml # Development compose file (for easy self-hosting setup)
Drizzle Studio provides a visual interface for managing your self-hosted database:
With Docker (self-hosting):
docker exec -it mockzilla-app-dev bun run db:pushWithout Docker (self-hosting):
bun run db:pushWhen running with an external PostgreSQL database, configure the DATABASE_URL environment variable:
# PostgreSQL connection string (when using external database)
DATABASE_URL=postgresql://username:password@host:5432/database_name- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For more information about running your own Mockzilla instance:
- Next.js Documentation (for understanding the UI)
- Drizzle ORM Documentation (for database management)
- Tailwind CSS Documentation (for UI customization)
- Docker Documentation (for containerized self-hosting)
This project is open source under MIT license
Deploy your own Mockzilla instance with β€οΈ using Next.js and Bun