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
/keysroutes 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
- On Meilisearch Cloud, the project's API Keys page shows the master key, but you can't change it yourself; contact support.
- Self-hosted, generate a new value of at least 16 bytes, for example with
uuidgenoropenssl rand. - Relaunch the instance with the new value in
MEILI_MASTER_KEYor--master-key. Resetting the master key invalidates every API key. - 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.