docker.recipes

Meilisearch Full-Text Search

beginner

Meilisearch instant search engine with web UI for index management.

Overview

Meilisearch is an open-source, lightning-fast search engine built in Rust that delivers instant search experiences with minimal configuration. Originally developed by Meili SAS as an alternative to complex solutions like Elasticsearch and expensive hosted services like Algolia, Meilisearch focuses on simplicity while providing powerful features like typo tolerance, faceted search, and sub-50ms response times. The engine is designed to work out of the box with sensible defaults, making it accessible to developers who need powerful search capabilities without the overhead of managing complex search infrastructure. This stack combines the core Meilisearch engine with meilisearch-ui, a community-developed web interface that provides visual index management capabilities. While Meilisearch offers a comprehensive RESTful API for programmatic interaction, the web UI simplifies tasks like creating indexes, uploading documents, configuring search settings, and testing queries. The two components communicate over a dedicated Docker network, with the UI connecting to Meilisearch's API to provide real-time index statistics, document management, and search testing capabilities. This combination is ideal for developers building applications that require instant search functionality, product managers who need to prototype search experiences quickly, and teams migrating from expensive hosted search solutions. Unlike Elasticsearch which requires extensive configuration and tuning, or Algolia which can become costly at scale, this Meilisearch stack provides enterprise-grade search capabilities with minimal operational overhead. The setup is particularly valuable for e-commerce platforms, documentation sites, content management systems, and any application where users expect Google-like search speed and tolerance for typos.

Key Features

  • Sub-50ms search response times with built-in performance optimizations
  • Automatic typo tolerance without configuration - handles up to 2 character mistakes per word
  • Faceted search and filtering with automatic facet detection from document structure
  • Custom ranking rules engine allowing fine-tuned relevance scoring based on business logic
  • Real-time search highlighting and snippet generation for result previews
  • Multi-tenancy support with API key-based access control and tenant isolation
  • Visual index management through meilisearch-ui with drag-and-drop document uploads
  • RESTful API with comprehensive JSON responses and OpenAPI documentation

Common Use Cases

  • 1E-commerce product catalogs requiring instant search with filters for price, category, and attributes
  • 2Documentation websites where users need to quickly find specific technical information
  • 3Content management systems with large article databases requiring full-text search
  • 4SaaS applications needing in-app search functionality for user-generated content
  • 5Migration projects moving away from expensive Algolia subscriptions to self-hosted solutions
  • 6Development teams prototyping search features before committing to complex Elasticsearch deployments
  • 7Small to medium businesses requiring powerful search without dedicated DevOps resources

Prerequisites

  • Minimum 1GB RAM available for optimal Meilisearch performance with medium datasets
  • Ports 7700 and 24900 available on the host system for API and UI access
  • MEILI_MASTER_KEY environment variable set for production security (minimum 16 characters)
  • Basic understanding of RESTful APIs for integrating search functionality into applications
  • JSON data format knowledge for document indexing and search result handling
  • Sufficient disk space for search indexes (typically 1.5-2x the size of source data)

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 meilisearch:
3 image: getmeili/meilisearch:v1.5
4 container_name: meilisearch
5 environment:
6 - MEILI_ENV=production
7 - MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
8 - MEILI_NO_ANALYTICS=true
9 volumes:
10 - meilisearch_data:/meili_data
11 ports:
12 - "7700:7700"
13 networks:
14 - meilisearch-network
15 healthcheck:
16 test: ["CMD", "wget", "--no-verbose", "--spider", "http://localhost:7700/health"]
17 interval: 10s
18 timeout: 5s
19 retries: 5
20
21 meilisearch-ui:
22 image: riccoxie/meilisearch-ui:latest
23 container_name: meilisearch-ui
24 ports:
25 - "24900:24900"
26 networks:
27 - meilisearch-network
28
29volumes:
30 meilisearch_data:
31
32networks:
33 meilisearch-network:
34 driver: bridge

.env Template

.env
1# Meilisearch
2MEILI_MASTER_KEY=your-master-key-at-least-16-bytes

Usage Notes

  1. 1API at http://localhost:7700
  2. 2UI at http://localhost:24900
  3. 3RESTful API with JSON
  4. 4Typo-tolerant by default
  5. 5Faceted search support

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

meilisearch
meilisearch:
  image: getmeili/meilisearch:v1.5
  container_name: meilisearch
  environment:
    - MEILI_ENV=production
    - MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
    - MEILI_NO_ANALYTICS=true
  volumes:
    - meilisearch_data:/meili_data
  ports:
    - "7700:7700"
  networks:
    - meilisearch-network
  healthcheck:
    test:
      - CMD
      - wget
      - "--no-verbose"
      - "--spider"
      - http://localhost:7700/health
    interval: 10s
    timeout: 5s
    retries: 5
meilisearch-ui
meilisearch-ui:
  image: riccoxie/meilisearch-ui:latest
  container_name: meilisearch-ui
  ports:
    - "24900:24900"
  networks:
    - meilisearch-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 meilisearch:
5 image: getmeili/meilisearch:v1.5
6 container_name: meilisearch
7 environment:
8 - MEILI_ENV=production
9 - MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
10 - MEILI_NO_ANALYTICS=true
11 volumes:
12 - meilisearch_data:/meili_data
13 ports:
14 - "7700:7700"
15 networks:
16 - meilisearch-network
17 healthcheck:
18 test: ["CMD", "wget", "--no-verbose", "--spider", "http://localhost:7700/health"]
19 interval: 10s
20 timeout: 5s
21 retries: 5
22
23 meilisearch-ui:
24 image: riccoxie/meilisearch-ui:latest
25 container_name: meilisearch-ui
26 ports:
27 - "24900:24900"
28 networks:
29 - meilisearch-network
30
31volumes:
32 meilisearch_data:
33
34networks:
35 meilisearch-network:
36 driver: bridge
37EOF
38
39# 2. Create the .env file
40cat > .env << 'EOF'
41# Meilisearch
42MEILI_MASTER_KEY=your-master-key-at-least-16-bytes
43EOF
44
45# 3. Start the services
46docker compose up -d
47
48# 4. View logs
49docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/meilisearch-stack/run | bash

Troubleshooting

  • Meilisearch container fails to start with 'invalid master key': Ensure MEILI_MASTER_KEY is at least 16 characters long and properly set in environment variables
  • Search queries return empty results despite indexed documents: Check that searchable attributes are configured correctly and documents contain the expected fields
  • UI shows 'Connection failed' to Meilisearch API: Verify both containers are on the same Docker network and Meilisearch health check is passing
  • High memory usage during indexing: Reduce batch size when adding documents or increase container memory limits for large datasets
  • Slow search performance on large indexes: Review and optimize ranking rules, consider splitting large indexes into smaller tenant-specific indexes
  • API returns 403 Forbidden errors: Verify the master key is correctly configured and API requests include proper Authorization headers

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Components

meilisearchmeilisearch-ui

Tags

#meilisearch#search#full-text#instant-search#algolia-alternative

Category

Database Stacks
Ad Space