Learn how to use Docker to download and run Meilisearch, configure its behavior, and manage your Meilisearch data.
In this guide you will learn how to use Docker to download and run Meilisearch, configure its behavior, and manage your Meilisearch data.Docker is a tool that bundles applications into containers. Docker containers ensure your application runs the same way in different environments. When using Docker for development, we recommend following the official instructions to install Docker Desktop.
Docker containers are distributed in images. To use Meilisearch, use the docker pull command to download a Meilisearch image:
docker pull getmeili/meilisearch:latest
Meilisearch deploys a new Docker image with every release of the engine. Each image is tagged with the corresponding Meilisearch version, indicated in the above example by the text following the : symbol. You can see the full list of available Meilisearch Docker images on Docker Hub.
The latest tag will always download the most recent Meilisearch release. Meilisearch advises against using it, as it might result in different machines running different images if significant time passes between setting up each one of them.
Meilisearch accepts a number of instance options during launch. You can configure these in two ways: environment variables and CLI arguments. Note that some options are only available as CLI arguments. Consult our configuration reference for more details.
If you want to pass command-line arguments to Meilisearch with Docker, you must add a line to the end of your docker run command explicitly launching the meilisearch binary:
By default, data written to a Docker container is deleted every time the container stops running. This data includes your indexes and the documents they store.To keep your data intact between reboots, specify a dedicated volume by running Docker with the -v command-line option:
The example above uses $(pwd)/meili_data, which is a directory in the host machine. Depending on your OS, mounting volumes from the host to the container might result in performance loss and is only recommended when developing your application.
To export a dump, use the create dump endpoint as described in our dumps guide. Once the task is complete, you can access the dump file in /meili_data/dumps inside the volume you passed with -v.To import a dump, use Meilisearch’s --import-dump command-line option and specify the path to the dump file. Make sure the path points to a volume reachable by Docker:
If you are storing your data in a persistent volume as instructed in the data persistency section, you must delete /meili_data/data.ms in that volume before importing a dump.
--snapshot-dir should point to a folder inside the Docker working directory for Meilisearch, /meili_data. Once generated, snapshots will be available in the configured directory.To import a snapshot, launch Meilisearch with the --import-snapshot option: