Migrate from legacy Java search engines. Deploy the blazing fast Rust powered Meilisearch configure Nginx reverse proxies and fix hidden mem
Ditch Elasticsearch: Install Native Rust Meilisearch on Ubuntu 24.04
Blindly installing Elasticsearch for full-text search is a massive architectural blunder. Built on the heavy Java Virtual Machine (JVM), Elasticsearch requires 4 to 8 GB of RAM just to boot up, forcing you to pay for expensive, RAM-heavy cloud VMs.
Enter Meilisearch: Engineered natively in Rust, it runs as a lightweight binary, starts on under 50 MB of RAM, offers out-of-the-box typo tolerance, and delivers sub-50ms query responses.
Here is the SRE guide to deploying Meilisearch on Ubuntu 24.04 bare metal without hitting performance traps:
Trap 1: The Base64 Master Key Crash
Never use Base64 strings for systemd environment master keys. Special characters like = and / will violently break the environment parser. Always generate pure hexadecimal keys:
# Generate a 32-byte secure alphanumeric master key MEILI_MASTER_KEY=$(openssl rand -hex 32) # Save securely in an isolated env file echo "MEILI_MASTER_KEY=$MEILI_MASTER_KEY" | sudo tee /etc/meilisearch/env >/dev/null sudo chmod 600 /etc/meilisearch/env
Trap 2: The Gzip Memory Explosion
Default Meilisearch settings reject uploads over 100 MB with a 413 Payload Too Large error. But uploading a giant 5 GB compressed .gz file directly into memory triggers the Linux OOM (Out Of Memory) killer, instantly crashing your server.
The Fix: Increase payload limits in systemd, lock indexing memory, and chunk your database using newline-delimited JSON (.ndjson):
# Split your massive database into 100k line chunks split -l 100000 massive_database.ndjson chunk_ # Stream chunks sequentially curl -X POST 'http://127.0.0.1:7700/indexes/products/documents' \ -H 'Content-Type: application/x-ndjson' \ -H "Authorization: Bearer YOUR_MASTER_KEY" \ --data-binary @chunk_aa
Trap 3: Hardening the Systemd Daemon
To handle heavy production traffic without running out of memory or file descriptors, configure /etc/systemd/system/meilisearch.service:
Ini, TOML [Unit] Description=Meilisearch Enterprise Search Engine After=network.target [Service] Type=simple User=meilisearch Group=meilisearch EnvironmentFile=/etc/meilisearch/env ExecStart=/usr/local/bin/meilisearch \ --env production \ --db-path /var/lib/meilisearch/data.ms \ --dump-dir /var/lib/meilisearch/dumps \ --snapshot-dir /var/lib/meilisearch/snapshots \ --schedule-snapshot \ --snapshot-interval-sec 86400 \ --http-payload-size-limit 500000000 \ --max-indexing-memory 2048Mb \ --http-addr 127.0.0.1:7700 Restart=on-failure RestartSec=5 # Unlock connection throughput LimitNOFILE=65536 [Install] WantedBy=multi-user.target
Trap 4: Nginx Payload Mismatch
When setting up an Nginx reverse proxy with Let's Encrypt SSL, ensure you set client_max_body_size 500M; inside your server block! If Nginx's body size limit doesn't match Meilisearch's HTTP payload limit, Nginx will block your document updates.
Bare Metal Search Supremacy
Ditch noisy cloud neighbors and hypervisor disk I/O bottlenecks. Deploy critical search clusters on ServerMO Bare Metal Dedicated Servers paired with ultra-fast NVMe storage and unmetered network bandwidth.
Read the complete Meilisearch Ubuntu 24.04 Installation Guide on ServerMO.com!












