What is WireMock Runner?
WireMock Runner is a long-running service packaged as a container that can be run anywhere you can deploy it. It connects to WireMock Cloud for configuration and collaboration, but executes recordngs and runs mock APIs locally in your environment. This architecture creates a clear separation of concerns:- The control plane (management, UI, collaboration) remains in WireMock Cloud
- The execution plane (mock API execution) runs wherever you need it - locally via CLI, in your environments via WireMock Runner or in WireMock Cloud.
Why WireMock Runner Exists
Traditional API mocking solutions force teams to choose between two extremes: Fully cloud-based approaches offer convenience and collaboration but struggle when APIs live behind firewalls, when teams need fast local feedback loops, or when security policies prohibit external connections. Fully self-hosted approaches provide control and privacy but require significant infrastructure investment, eliminate the benefits of cloud collaboration, and create maintenance overhead. WireMock Runner was designed to resolve this tension. It enables teams to adopt the workflow that matches their needs rather than adapting their needs to match the tool’s constraints.How WireMock Runner Works
The Runner operates as a containerized service with two primary modes:Record Mode
In record mode, the Runner automatically creates or updates mock APIs by capturing real API traffic. This allows teams to build or refresh mock specifications from actual service behavior, keeping mocks aligned with reality as APIs evolve. Recording can happen locally during development, in CI/CD during integration tests or deployments, or in any environment where you need to capture API interactions (see Recording on Kubernetes for an example).Run Mode
In Run / serve mode, the Runner retrieves mock specifications from WireMock Cloud (or uses already locally stored mock confgiuraitons) and serves them locally. Incoming requests are matched against these specifications and responded to according to the stub definitions—all without the request ever leaving your infrastructure. This enables development, testing, and even production-like environments to operate with simulated APIs while remaining completely isolated from external networks.Mode Switching
The Runner can be switched between modes dynamically via its HTTP management interface. This allows the same Runner instance to record new interactions during certain workflows and serve those interactions during others—orchestrated by your existing automation.Using WireMock Runner
Git and CI/CD Integration
Mock specifications can live in version control alongside the code they support. WireMock Runner can pull the latest mocks at the start of a CI run, record new interactions during tests, and push updated specifications back to Git—all automated within your existing CI/CD pipeline. This treats mocks as first-class artifacts: versioned, reviewed through pull requests, and promoted through environments just like application code. See Promoting APIs with Git and CI/CD for a detailed workflow guide.Environment-Specific Configuration
Different environments often require different mock behavior. WireMock Runner supports environment-specific profiles, allowing you to maintain variations for local development, CI, staging, and production-like environments—all in the same repository, all promoted through the same workflow.Multi-Location Deployment
Because Runner is a container, it can be deployed anywhere:- On a developer’s laptop for fast local iteration
- Inside a CI pipeline for automated testing
- In a Kubernetes cluster behind the firewall for team environments (see Running on Kubernetes)
- In multiple regions or data centers for distributed teams