This directory contains a Docker Compose configuration for running Meilisearch as a containerized service.
This setup creates a Meilisearch service that:
- Persists search index data in a Docker volume
- Exposes a configurable port for direct access from applications
- Runs in development mode with configurable master key and payload size limits
- Docker and Docker Compose installed
Before starting the service, configure the following in meilisearch.compose.yml:
- Port Mapping: Replace
xxxin the ports section with your desired host port (e.g.,42341:7700) - MEILI_MASTER_KEY: Replace
xxxwith a secure master key for authentication - MEILI_HTTP_PAYLOAD_SIZE_LIMIT: (Optional) Replace
xxxwith the maximum payload size (e.g.,100MBor104857600for 100MB in bytes). This is not needed for 99% of cases and can be removed if not required.
Start the Meilisearch service using Docker Compose:
docker compose -f meilisearch.compose.yml up -dThe -d flag runs the container in detached mode (in the background).
Check that the container is running:
docker ps | grep meilisearchYou can also test the service by checking the health endpoint (replace 42341 with your configured port):
curl http://localhost:42341/healthBefore connecting, ensure you've configured the port mapping in meilisearch.compose.yml (replace xxx with your desired host port).
Applications can connect to Meilisearch using:
- Host:
localhost(or127.0.0.1) - Port: The host port you configured in
meilisearch.compose.yml(container port is always7700) - Master Key: The value you set for
MEILI_MASTER_KEYin the compose file - API Endpoint:
http://localhost:<your-configured-port>
// Using the Meilisearch JavaScript client
import { MeiliSearch } from "meilisearch";
const client = new MeiliSearch({
host: "http://localhost:<your-configured-port>",
apiKey: "your-master-key-here",
});- Data Storage: Search index data is stored in the
meili_dataDocker volume and persists across container restarts - Master Key: The master key is required for all operations. Keep it secure and never commit it to version control
- Port Configuration: Configure the port mapping in
meilisearch.compose.ymlby replacingxxxwith your desired host port. The container port is always7700 - Environment: Currently set to
development. Change toproductionfor production deployments - Payload Size Limit: The
MEILI_HTTP_PAYLOAD_SIZE_LIMITenvironment variable is optional and not needed for most use cases. Only configure it if you need to handle very large document payloads