Configuration reference
A self-hosted installation’s settings live in .env in the installation directory, which the first ./mockhub install writes from env.template. Change one by editing .env and running ./mockhub install again. The images are not set here: release.env, which ships with each release, pins them.
Required
Section titled “Required”install stops and lists any of these that is empty or not valid.
| Setting | What it is |
|---|---|
API_HOST |
The API’s hostname, which the app, the CLI and AI assistants call, such as api.mockhub.example.com |
GATEWAY_HOST |
The gateway’s hostname. Each project answers on a subdomain of it, and its DNS needs a wildcard, *.GATEWAY_HOST. The apex is served too |
UI_HOST |
The app’s hostname, which people open, and which emailed links point at |
DOCS_HOST |
Where the installation serves this documentation. The app and emails link to it |
SUPPORT_EMAIL |
The mailbox emails name, and the one replies reach |
ABUSE_EMAIL |
The mailbox that receives reports about mocks |
SECURITY_EMAIL |
The contact security.txt names |
MAILER_DSN |
Your mail relay, such as smtp://user:password@smtp.example.com:587. See Connect mail and GitHub or Google sign-in |
MAILER_FROM_ADDRESS |
The address emails are sent from |
MAILER_FROM_NAME |
The name emails are sent from. MockHub by default |
TLS_MODE |
Where the edge’s certificates come from: files, acme_http or internal. See Choose a TLS mode |
Optional
Section titled “Optional”| Setting | Default | What it does |
|---|---|---|
EDGE_BIND_ADDRESS |
0.0.0.0 |
The IPv4 address the edge publishes ports 80 and 443 on: 0.0.0.0 for every address, or one address of the host (Inbound) |
INTERNAL_SUBNET |
172.28.0.0/16 |
The internal Docker network. Change it only when it collides with a network the host routes to |
EDGE_SUBNET, EDGE_ADDRESS |
172.30.0.0/24, 172.30.0.10 |
The edge’s Docker network and the edge’s address in it, which the app trusts for the client’s address. EDGE_ADDRESS must lie inside EDGE_SUBNET |
EGRESS_ALLOWED_HOSTS |
Empty | Internal names that upstreams, webhooks and MCP sign-in may reach although they resolve to a private address. See Network requirements |
COMPOSE_PROFILES |
Empty | Optional parts, comma-separated. geoip downloads MaxMind’s GeoLite2 databases weekly; without it, geolocation is off |
GEOIPUPDATE_ACCOUNT_ID, GEOIPUPDATE_LICENSE_KEY |
Empty | Your MaxMind credentials, for the geoip profile |
OAUTH_GITHUB_CLIENT_ID, OAUTH_GITHUB_CLIENT_SECRET |
Empty | Sign-in with GitHub. Set both or neither |
OAUTH_GOOGLE_CLIENT_ID, OAUTH_GOOGLE_CLIENT_SECRET |
Empty | Sign-in with Google. Set both or neither |
MOCKHUB_LICENCE_POLICY |
Empty | Leave it empty: the release’s app image decides whether a licence governs, and refuses to start with the other policy named |
REGISTRATION_MODE |
invitation |
Who can create an account: invitation, domain or open. See Choose who can sign up |
REGISTRATION_ALLOWED_DOMAINS |
Empty | The email domains domain mode admits, comma-separated |
PASSWORD_BREACH_CHECK |
disabled |
enabled refuses a new password found in a known data breach, asking Pwned Passwords; disabled asks nothing. See below |
AI_GENERATION_POLICY |
disabled |
disabled keeps every AI provider call on the host, whatever else is set; enabled lets OPENROUTER_API_KEY decide |
OPENROUTER_API_KEY |
Empty | The OpenRouter key AI generation and the assistant use, once AI_GENERATION_POLICY is enabled |
OPENROUTER_MODEL |
The release’s | The model they use |
REALTIME_ENABLED |
1 |
Live request logs in the app. 0 turns them off |
MCP_OAUTH_ENABLED |
false |
Sign-in for AI assistants that connect with OAuth instead of a personal token |
BACKUP_DIR |
backups |
Where ./mockhub backup writes recovery sets, relative to the installation directory or absolute |
BACKUP_KEEP |
7 |
How many complete recovery sets are kept |
AI generation and the assistant send specifications, examples and request data to the provider. Turn them on only once your organisation has approved the provider, the models and the data sent; a licence must also grant AI generation.
Checking passwords against known breaches
Section titled “Checking passwords against known breaches”With PASSWORD_BREACH_CHECK=enabled, each time someone sets a password (signing up, changing or resetting it, an administrator setting it, or install creating the first administrator), MockHub sends the first five hexadecimal characters of the password’s SHA-1 hash to api.pwnedpasswords.com on port 443. It refuses the password if the answer lists it. The password and the rest of its hash never leave the host. If the service does not answer within 3 seconds, the password is accepted, so an outage there never stops anyone setting a password.
It is disabled by default, so nothing is sent and a password that appears in a known breach is accepted. Every other password rule still applies. To turn it on, allow the destination through the firewall (see Network requirements), set PASSWORD_BREACH_CHECK=enabled in .env and run ./mockhub install. It applies to passwords set from then on; existing passwords are not checked.
The thresholds and canary of ./mockhub status are settings too; see The mockhub command.
Generated
Section titled “Generated”The rest of .env is written by install: the hostname patterns and the edge’s TLS options, rewritten from the settings above on every run, and the installation’s secrets, generated once. Never edit them by hand, and never lose them: the cipher secrets decrypt stored credentials and authenticator secrets, and nothing recovers them. Every backup encrypts a copy into its recovery kit.
Limits
Section titled “Limits”- Every setting needs
./mockhub installagain to take effect, which restarts what changed behind the maintenance page. - Settings not listed here are not supported. A variable the release does not pass to its services does nothing, and
./mockhub support-bundlenames any setting an installation added beyond the template.