MockHub

Every dependency. Mocked in minutes.

A self-hosted mock server for REST and SOAP that the whole team can use. Give each service its own URL, edit stubs in a real UI, and hand developers a Postman or Bruno collection that already works.

$ docker run -p 8080:8080 -v mockhub-data:/data abhaypratap/mockhub
mockhub.devops-monk.com
The MockHub stub editor showing the Petstore example: a list of routes on the left and the editor for GET /pets/{id} on the right

Built on WireMock. Made for teams.

Everything WireMock can do, organised into projects, editable by anyone, and safe across restarts.

One URL per service.

Each project lives under its own base path. Point your service's config at it, and leave the real dependency out of your test environment.

GET/payment-service/payments/{id}200
POST/payment-service/refunds201
POST/legacy-crm/ws/customers500
DELETE/orders/items/{id}401
0

Lost mocks after a restart.

Every stub is written to disk, including ones created through the native WireMock API. Mount a volume and redeploy with confidence.

Dynamic responses.

Echo path variables, read the JSON body, generate IDs and dates with Handlebars templating.

{ "id": "{{request.path.id}}",
  "at": "{{now}}" }

Stateful flows.

Scenarios let the same call answer differently as state changes: empty cart, item added, checked out.

Chaos on demand.

Delays, random latency, dropped connections and 503s to prove your timeouts and retries actually work.

Try it without leaving the editor.

Send a real request to the stub you're editing and see status, headers, body and timing. A live request log shows every call, with the closest stub for anything that didn't match.

Start from contracts.

Import an OpenAPI or Swagger spec, a WSDL, or existing WireMock mappings, and get working stubs with realistic sample data in one step.

SOAP is a first-class citizen.

Drop in a WSDL and MockHub creates one stub per operation, with request and response envelopes generated from the schema.

  • Matches on the operation inside soap:Body, or on any field value with XPath
  • SOAP 1.1 and 1.2, envelope and fault helpers
  • ?wsdl served with its address pointing at the mock
  • A clear SOAP fault for operations you haven't mocked yet
Editing a SOAP stub that matches Add requests where a is 2 and b is 3

Your mocks, in their favourite client.

Export any project as a Postman collection or a Bruno collection. Every request is ready to send, with a status check included. One baseUrl variable switches between the mock and the real service.

Postman

Collection v2.1, grouped into folders, path variables filled in, and a test that checks the expected status.

pm.test("Status is 201", () =>
  pm.response.to.have.status(201));

Bruno

A zip of plain .bru files with a MockHub environment. Unzip it, open the collection, and commit it next to your code.

post {
  url: {{baseUrl}}/pets
  body: json
}
assert { res.status: eq 201 }

From zero to mocked in three steps.

Run it

One container, one port. Data goes to /data.

docker run -p 8080:8080 \
  -v mockhub-data:/data \
  abhaypratap/mockhub

Create a project

In the UI, or straight from your CI pipeline.

curl -X POST localhost:8080/__admin/mockhub/api/projects \
  -d '{"name":"Payment service"}'

Point your service at it

Swap the dependency's URL for the project's mock URL.

PAYMENT_API_URL=http://mockhub:8080/payment-service

Runs wherever your tests do.

A single JAR in a 115 MB distroless image for amd64 and arm64. It runs as non-root, is configured through environment variables, and has a built-in health check.

docker run -d --name mockhub -p 8080:8080 \
  -v mockhub-data:/data \
  -e MOCKHUB_PUBLIC_URL=https://mocks.acme.internal \
  -e MOCKHUB_USERS="lead:s3cret:admin,qa:qa-pass:editor" \
  abhaypratap/mockhub
The request log showing matched and unmatched requests with response codes

Learn by example.

Five ready-made projects install with one click: REST basics, response templating, a stateful shopping cart, faults and delays, and a SOAP service generated from a WSDL. Every stub explains the technique it uses.

Browse them in the live demo

Stop waiting on other teams' services.

Free, self-hosted, and running in under a minute.