Skip to content

Installation

mockd is distributed as a single binary with no external dependencies. Choose the installation method that works best for your environment.

The fastest way to install mockd on Linux or macOS:

Terminal window
curl -sSL https://get.mockd.io | sh

This detects your OS and architecture automatically and installs the latest release.

Terminal window
brew install getmockd/tap/mockd

Download the latest release for your platform:

Terminal window
curl -sSL https://github.com/getmockd/mockd/releases/latest/download/mockd-linux-amd64 -o mockd
chmod +x mockd
sudo mv mockd /usr/local/bin/

Verify the installation:

Terminal window
mockd --version

If you have Go 1.25+ installed:

Terminal window
go install github.com/getmockd/mockd/cmd/mockd@latest

This installs mockd to your $GOPATH/bin directory. Make sure it’s in your PATH.

Terminal window
# Download latest release
Invoke-WebRequest -Uri "https://github.com/getmockd/mockd/releases/latest/download/mockd_windows_amd64.zip" -OutFile "mockd.zip"
# Extract
Expand-Archive -Path "mockd.zip" -DestinationPath "."
# Add to PATH (current session)
$env:PATH += ";$PWD"
# Or move to a directory in your PATH
Move-Item mockd.exe C:\Users\YourName\bin\

If you have Scoop installed:

Terminal window
scoop install mockd
Terminal window
mockd --version

If you have Go 1.25+ installed:

Terminal window
go install github.com/getmockd/mockd/cmd/mockd@latest

This installs mockd to your $GOPATH/bin directory. Make sure it’s in your PATH.

Pull and run the official Docker image:

Port 4280 serves mock traffic. Port 4290 is the Admin API for managing mocks at runtime.

Terminal window
# Pull the latest image
docker pull ghcr.io/getmockd/mockd:latest
# Run with both mock and admin ports exposed
docker run -p 4280:4280 -p 4290:4290 ghcr.io/getmockd/mockd
# Run with a local config file
docker run -p 4280:4280 -p 4290:4290 -v $(pwd)/mockd.yaml:/mockd.yaml ghcr.io/getmockd/mockd serve --config /mockd.yaml
services:
mockd:
image: ghcr.io/getmockd/mockd:latest
ports:
- "4280:4280" # Mock server
- "4290:4290" # Admin API
volumes:
- ./mockd.yaml:/mockd.yaml
command: serve --config /mockd.yaml

Clone and build the project:

Terminal window
git clone https://github.com/getmockd/mockd.git
cd mockd
go build -o mockd ./cmd/mockd

After installation, verify mockd is working:

Terminal window
# Check version
mockd --version
# Show help
mockd --help
# Start a simple mock server (creates default config if none exists)
mockd start