Latest Posts

Installing and safely upgrading Meilisearch to the latest version


Meilisearch is an amazing open-source search engine with an intuitive API to rival the likes of Algolia. Upgrading can be scary, so I automated it with a bash script!

Meilisearch is an amazing standalone binary, a performant search engine that rivals the likes of Algolia. It's self hosted, open source and can be run on very little resources.

Upgrading it is a scary process, so I've written an automation script for Linux and thought I'd share it here for my own reference and others!


To install Meilisearch, simply use their download script, make it executable, move it to your binaries path and and create a systemctl control script:

  1. Grab the meilisearch binary
# execute the installer
curl -s -L | sh > /dev/null

# make the binary executable
chmod +x ./meilisearch

# move it to your binary path
mv ./meilisearch /usr/bin/meilisearch
  1. Create a systemctl service file under /etc/systemd/system/meilisearch.service (make sure to set your own master key, I'd recommend a 60+ character token)
ExecStart=/usr/bin/meilisearch --http-addr --db-path=/etc/meilisearch/ --no-analytics --dump-dir=/etc/meilisearch/dumps --env=production --master-key [YOUR MASTER KEY]
  1. Load in your service by running systemctl daemon-reload

  2. Now you can start your service for the very first time by running systemctl start meilisearch, all being well, your service should be running and logs visible via journalctl: journalctl -xe -u meilisearch


  1. Save the below code snippet into a file called




# download latest meilisearch
echo "Downloading latest Meilisearch"
curl -s -L | sh > /dev/null

# clear our existing dumps
rm -rf /etc/meilisearch/dumps/*.dump

# create a dump with the existing service
response=$(curl -s -o /dev/null -w "%{http_code}" -X POST "" -H "Authorization: Bearer $masterKey")

# check we managed to queue a dump...
if [ "$response" -ne 202 ]; then
  echo "Failed to create dump: Response code $response"
  exit 1

echo "Waiting for dump creation..."
while ! test -f /etc/meilisearch/dumps/*; do sleep 1; done

filename=$(ls /etc/meilisearch/dumps/*)

echo "Found dump $filename, lets give it another 10 seconds..."

sleep 10

echo "Stopping Meilisearch"
systemctl stop meilisearch

# create our new binary and move it
chmod +x ./meilisearch
mv ./meilisearch /usr/bin/meilisearch

# load our new binary
systemctl daemon-reload

# move our data directory
mv /etc/meilisearch/ /etc/meilisearch/

# run with our dump
/usr/bin/meilisearch --import-dump "$filename" --http-addr --db-path=/etc/meilisearch/ --no-analytics --dump-dir=/etc/meilisearch/dumps  --env=production --master-key $masterKey
  1. Run this file by calling sh ./ This script automates the snapshotting up, stopping and restoring the snapshot of Meilisearch.

Once you see the Meilisearch ASCII text, give everything a test and check everything is working as expected, exit out of the process and call on systemctl to manage the process itself with systemctl restart meilisearch

If you're not such a fan of managing your own infrastructure, Meilisearch has their own competitively priced cloud offering, suprisingly called Meilisearch Cloud!