Run mock server on localhost

Archived topic — some details may be out of date.
Mock servers built from saved collection examples are still supported. Postman now also has code-based mocks: JavaScript request handlers plus a config.yaml, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (postman mock generate) and run it (postman mock run). See About mocks and Create a mock.
Working with an AI coding agent? The Postman plugin can build and run mocks for you.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

Hi,

Is it possible to run an offline mock server with Postman? Currently we are using WireMock for our mocks, and are able to run an offline WireMock server for running our UI tests on our CI server. We feel that our tests shouldn’t need to access the network as this makes them non deterministic. Hopefully someone can point me in the right direction.

try mockoon

With the release of V12, Local Mocks can now be used in the platform. :heart:

You can now create a mock server that simulates a real API server in your local Git repository, where you’re making API changes. This enables you to quickly set up your service locally by mocking the APIs it depends on.

You can create a local mock server from a template to define logic yourself or use Agent Mode to quickly get started.

You can also use the Postman CLI to validate your collection’s tests against a mock server or start a mock server in your CI/CD pipeline. Once your local mock server is running, you can send requests to it just like a real API.

To learn more, see Simulate your API locally using a Git-backed mock server.