# Pact Stub Server

Pact Stub Server is a standalone server that generates mock responses from Pact contract files, implementing the V4 Pact specification. It is open source and self-hosted, installable on Docker Hub.

Canonical page: https://ourlocalhost.com/app/5221/pact-stub-server

## Description

Pact Stub Server is a standalone server that generates mock responses from Pact contract files, implementing the V4 Pact specification. It lets development and testing teams run and verify their applications against a simulated service without the real dependency being active.

## Platform availability

Available on 0 of 10 platforms.

## Health score

44/100 (Fair), based on 4 of 5 factors.
- Maintained: 70 (last commit 102 days ago)
- Popular: 38 (80 GitHub stars)
- Easy to install: 25 (0 install platforms, install notes, Docker image)
- Security check: 20 (1 serious finding, 5 minor, CI, tests)

## Security check

1 serious finding: Uses zip 8.6.0, which has a known critical vulnerability.
Automated checks on commit 927275f, 11 Nov 2026. Not an audit.

## Links

- GitHub: https://github.com/pact-foundation/pact-stub-server
- Docker Hub: https://hub.docker.com/r/pactfoundation/pact-stub-server
- Documentation: https://docs.rs/crate/pact-stub-server

## Common questions

### Why does the Pact stub server fail to start after installing it?

Download the correct Linux Pact mock server and verifier binaries for your machine and confirm they work by running --help. Missing or wrong-type tools can prevent the stub server from starting.

### How do I choose the port and Pact file output location before running the stub?

Use -o to choose where Pact files are saved and use -p or --base-port to choose the network port. The main server defaults to port 8080, and blocked or random ports can stop other apps from reaching the stub.

### Will the stub server respond if a request does not exactly match a pact interaction?

Yes, it will always try to return a response, even when there is not an exact match with the pact files.

### Can I use it to stub backend servers while developing mobile apps?

Yes, the stub server was designed to support prototyping mobile applications by stubbing out backend servers.

---
Source: Our Local Host (https://ourlocalhost.com/app/5221/pact-stub-server), the self-hosted and open-source app directory.
