Keys / Meilisearch

MEILI_MASTER_KEY

The master key a Meilisearch instance starts with. It protects every route but /health; use it to manage API keys, and give apps an API key.

Expires
never; you replace it
API
none; the /keys routes can't list or change it

Get it

Create one on cloud.meilisearch.com. The steps aren't recorded yet.

Set it

MEILI_MASTER_KEY=...

The Meilisearch server reads it at launch, as it reads --master-key. The Meilisearch MCP server reads it too. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. On Meilisearch Cloud, the project's API Keys page shows the master key, but you can't change it yourself; contact support.
  2. Self-hosted, generate a new value of at least 16 bytes, for example with uuidgen or openssl rand.
  3. Relaunch the instance with the new value in MEILI_MASTER_KEY or --master-key. Resetting the master key invalidates every API key.
  4. Meilisearch Cloud generates new default API keys. Self-hosted, list or create them with the new master key. Deploy them everywhere the old ones were used.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16