wiremock.yaml file is used by the WireMock CLI to configure local mock services. It defines service configurations including HTTP/HTTPS ports, TLS certificates, API types, and cloud synchronization settings.
File location
Thewiremock.yaml file should be placed in your WireMock working directory (typically .wiremock by default, or as specified with the --wiremock-dir argument).
Schema validation
The configuration file conforms to the JSON Schema specification available at: https://static.wiremock.io/schemas/wiremock.yaml-schema.jsonRoot structure
Global configuration
Theglobal section contains configuration that applies to all services by default.
Global HTTPS settings
https section will use it by default unless they specify their own certificate.
Services
Theservices section is a map of service names to their configurations. Service names are user-defined identifiers.
Required service properties
Each service must define these properties:type
The type of mock API.- Type:
string - Required: Yes
- Valid values:
REST,Unstructured,gRPC,GraphQL(case insensitive)
name
Human-readable name for the service.- Type:
string - Required: Yes
port
HTTP port number for the service.- Type:
integer - Required: Yes (or
httpsmust be provided) - Valid range: 1-65535
Optional service properties
description
Optional description of the service.- Type:
string - Required: No
cloud_id
WireMock Cloud mock API ID for syncing with cloud.- Type:
string - Required: No
- Pattern: 4-15 lowercase alphanumeric characters
path
Path to the directory containing stub mappings, files, and API specifications. The path is relative to the location ofwiremock.yaml.
- Type:
string - Required: No
mappings/- Stub mapping JSON files__files/- Response body filesapi-spec.jsonorapi-spec.yaml- OpenAPI/GraphQL schema
open_api
OpenAPI-specific configuration for validation.- Type:
object - Required: No
validation_mode- Controls OpenAPI request/response validation- Type:
string - Valid values:
none,soft,hard - Default:
none none- No validationsoft- Validation warnings logged but requests not rejectedhard- Invalid requests are rejected
- Type:
https
HTTPS configuration for the service. See the TLS/HTTPS Configuration section below.- Type:
object - Required: No (but either
portorhttpsmust be provided)
originals
Map of original service URLs for recording and proxying.- Type:
object - Required: No
TLS/HTTPS configuration
Services can be configured to run over HTTPS using TLS certificates. TLS can be configured globally (for all services) or per-service.HTTPS service configuration
port- HTTPS port number (required, 1-65535)certificate- Certificate configuration (optional, inherits from global if not specified)
Certificate configuration
Certificates can be configured in three ways:PEM file
A PEM-encoded file containing both the RSA private key and X509 certificate.wiremock.yaml file.
PEM file format:
PKCS12 or JKS keystore
A keystore file (PKCS12 or JKS format) containing the private key and certificate.keystore- Path to the keystore file (absolute or relative towiremock.yaml)password- Password to unlock the keystore (required)alias- Optional alias to select a specific certificate if the keystore contains multiple entries. If omitted, the first entry is used.
Certificate alias reference
When a global keystore is configured, individual services can reference specific certificates by alias:Default self-signed certificate
If no certificate is configured, services will use WireMock’s default self-signed certificate.Profiles
Configuration overrides can be defined in profile files namedwiremock-<profile-name>.yaml.
These files overlay the base configuration when running commands with the --profile/-p flag.
See Managing Environments for more information about using profiles to manage environments in WireMock Cloud.