Back to Blog
Tutorial9 min read2026-06-30

How to Deploy a Meilisearch Search Server

Stand up a fast, typo-tolerant Meilisearch instance in production: persistent storage, master keys and API key scoping, indexing your first documents, and keeping memory in check.

Ajay Kumar
Ajay Kumar
Founder & DevOps, PandaStack

Meilisearch is a search engine built for instant, typo-tolerant, relevance-tuned search with almost no configuration. It's a single Rust binary, which makes it one of the easiest search engines to self-host — the catch is that search engines are stateful, and getting persistence and security right is what separates a demo from production.

Single binary, persistent data

Meilisearch stores its indexes on disk in a directory (default ./data.ms). The number-one self-hosting mistake is running it in a container without a persistent volume — restart the container and your indexes vanish. Always mount durable storage at the data path.

Deploy the official getmeili/meilisearch image. It listens on port 7700.

# key settings
MEILI_ENV=production
MEILI_MASTER_KEY=a-long-random-secret-at-least-16-bytes
MEILI_DB_PATH=/meili_data

When MEILI_ENV=production, Meilisearch refuses to start without a master key — a good safety default. The disabled web search preview in production mode is also intentional.

Key management

The master key is the root credential. You almost never use it directly in clients. Instead you derive scoped API keys:

  • A search key with only search action, safe to embed in a frontend.
  • An admin key with document and index management actions, kept server-side.
curl -X POST 'https://your-app/keys' \
  -H "Authorization: Bearer $MEILI_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"actions":["search"],"indexes":["products"],"expiresAt":null}'

Embedding the master key in a browser is the classic security incident. Use a search-only key for anything client-side, and tenant tokens if you need per-user document filtering.

Indexing documents

Meilisearch is schemaless — push JSON and it infers fields. Every document needs a primary key.

curl -X POST 'https://your-app/indexes/products/documents' \
  -H "Authorization: Bearer $ADMIN_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @products.json

Indexing is asynchronous; you get a task ID and poll /tasks/:uid for completion. Tune relevance with index settings — searchableAttributes, filterableAttributes, sortableAttributes, and ranking rules — rather than at query time.

SettingWhat it controls
searchableAttributesWhich fields are searched + their priority
filterableAttributesFields usable in filter=
sortableAttributesFields usable in sort=
rankingRulesRelevance ordering
stopWordsIgnored common words

Memory and sizing

Meilisearch is fast partly because it memory-maps its index. Plan for RAM proportional to your dataset and indexing throughput — bulk indexing in particular is memory-hungry. For production, pick a memory-optimized compute tier rather than the smallest free tier once your dataset grows beyond a toy. On PandaStack, m1/m2 memory-optimized tiers exist precisely for workloads like this.

Backups

Use Meilisearch dumps for portable, version-independent backups and snapshots for fast restore on the same version. Schedule a dump export on a cronjob and copy it to object storage. Because the data directory lives on a persistent volume, you're protected against container restarts, but a logical dump protects you against corruption and bad migrations.

Go-live checklist

  • Persistent volume mounted at the data path
  • MEILI_ENV=production + master key set
  • Search-only key issued for frontend; master key server-side only
  • Index settings tuned (searchable/filterable/sortable)
  • Scheduled dump to object storage
  • Memory-appropriate compute tier

References

  • [Meilisearch self-hosted guide](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch)
  • [Meilisearch configuration / env vars](https://www.meilisearch.com/docs/learn/configuration/instance_options)
  • [Meilisearch security & API keys](https://www.meilisearch.com/docs/learn/security/basic_security)
  • [Snapshots and dumps](https://www.meilisearch.com/docs/learn/data_backup/snapshots_vs_dumps)

Deploying Meilisearch on PandaStack means a container service with persistent storage and a memory-optimized tier when you need it, plus cronjobs for scheduled dumps. Start free at [dashboard.pandastack.io](https://dashboard.pandastack.io).

Ready to deploy?

Start free on PandaStack.

Start free on PandaStack

More in Tutorial

Browse all Tutorial articles →

See also