Self-host your mocks with Mockoon CLI

Run your mock APIs in your CI/CD pipeline, on your servers or in your cloud environments with Mockoon CLI

Mockoon CLI screenshot

Mockoon's perfect complement for all your headless and automated environments.

Supports all Mockoon's features

The CLI supports all of Mockoon's features: dynamic templating, response rules, proxy mode, OpenAPI compatibility, etc.

View all features

Lightweight and fast

Deploy lighting fast mock servers in your CI environment with a simple and easy to use NPM package or Docker image.

How to use it

Run your mocks anywhere

Also available as a Docker image and a GitHub Action, run your mock APIs in your favorite CI platform!

Getting started tutorial

NPM package quick start

Copy
$ npm install -g @mockoon/cli $ mockoon-cli start --data ./data-file.json

Docker image quick start

Copy
$ docker run -d --mount type=bind,source=/data-file.json,target=/data,readonly -p 3000:3000 mockoon/cli:latest -d data -p 3000

GitHub Action quick start

Copy
- name: Run Mockoon CLI uses: mockoon/cli-action@v2 with: # Mockoon CLI version, default to 'latest' version: "latest" # Mockoon local data file or URL data-file: "./mockoon-data.json" # port, default to 3000 port: 3000 - name: Make test call run: curl -X GET http://localhost:3000/endpoint