Introduction
Mockoon is a free, open-source tool for creating mock HTTP APIs without writing code. It was built to solve the problem of frontend developers waiting on backend teams by providing a fast way to simulate any API locally. It runs as a desktop app or a CLI for CI integration.
What Mockoon Does
- Creates mock REST API endpoints with custom HTTP methods, paths, and status codes
- Returns dynamic responses using a built-in templating system with Handlebars
- Simulates latency, errors, and sequential responses for realistic testing
- Supports request logging to inspect incoming calls during development
- Exports and imports environment files for sharing mocks across a team
Architecture Overview
Mockoon is an Electron-based desktop application with an Express.js server running under the hood. Each mock environment spawns an independent Express server on a user-defined port. The CLI version (@mockoon/cli) uses the same Express-based core without the Electron shell, making it suitable for Docker and CI pipelines. Configuration is stored as JSON files.
Self-Hosting & Configuration
- Install the desktop app from the official site or via package managers
- Use the CLI (
@mockoon/cli) for headless operation in Docker or CI - Define environments as JSON files that can be version-controlled
- Configure proxy mode to forward unmatched requests to a real backend
- Set up HTTPS with custom certificates for testing TLS-dependent clients
Key Features
- No-code visual editor for defining routes, headers, and response bodies
- Handlebars-powered response templating with access to request data
- Proxy mode that forwards unmatched routes to a live API server
- CORS pre-configured by default to work with browser-based frontends
- CLI and Docker support for running mocks in automated test pipelines
Comparison with Similar Tools
- Postman Mock Server — cloud-based mocking tied to a Postman account and paid plans
- WireMock — Java-based mock server with more advanced matching but heavier setup
- JSON Server — quick REST API from a JSON file but limited templating and no GUI
- MSW (Mock Service Worker) — intercepts requests in the browser but not a standalone server
- Prism — generates mocks from OpenAPI specs but less flexible for custom responses
FAQ
Q: Is Mockoon free for commercial use? A: Yes. Mockoon is MIT-licensed and free for any use including commercial projects.
Q: Can I run Mockoon in Docker?
A: Yes. Use the CLI package (@mockoon/cli) with the official Docker image or build your own.
Q: Does Mockoon support OpenAPI import? A: Yes. You can import OpenAPI/Swagger specifications to auto-generate mock endpoints.
Q: Can multiple developers share the same mock configuration? A: Yes. Export the environment as a JSON file and commit it to version control for the team to share.