---
title: "Deploy Meilisearch"
description: "Instant typo-tolerant search engine - single 50MB Rust binary"
category: "Other"
url: https://railway.com/deploy/meilisearch-4
---

# Deploy Meilisearch

Instant typo-tolerant search engine - single 50MB Rust binary

**[Deploy Meilisearch on Railway](https://railway.com/template/meilisearch-4)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/meilisearch-4/manifest.json

- **Creator:** mcmax
- **Category:** Other

## Template content

### meilisearch-lite

- **Image:** getmeili/meilisearch:v1.12
- **Start command:** `/bin/sh -c 'mkdir -p /meili_data/snapshots /meili_data/dumps /meili_data/tmp; C=""; if [ -r /sys/fs/cgroup/cpu.max ]; then CM=$(cat /sys/fs/cgroup/cpu.max); Q=${CM%% *}; P=${CM##* }; if [ "$Q" != "max" ] && [ -n "$P" ]; then C=$(( (Q + P - 1) / P )); fi; fi; [ -n "$C" ] || C=2; [ "$C" -le 4 ] || C=4; T=$(( C / 2 )); [ "$T" -ge 1 ] || T=1; M=""; if [ -r /sys/fs/cgroup/memory.max ]; then MM=$(cat /sys/fs/cgroup/memory.max); if [ "$MM" != "max" ]; then M=$MM; fi; fi; [ -n "$M" ] || M=2147483648; [ -n "$MEILI_MAX_INDEXING_THREADS" ] || export MEILI_MAX_INDEXING_THREADS=$T; [ -n "$MEILI_MAX_INDEXING_MEMORY" ] || export MEILI_MAX_INDEXING_MEMORY=$(( M / 2 )); echo "railway: cgroup cpus=$C mem=$M -> indexing_threads=$MEILI_MAX_INDEXING_THREADS indexing_mem=$MEILI_MAX_INDEXING_MEMORY"; exec tini -s -- /bin/meilisearch'`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Meilisearch Lite — Instant Search Engine

Blazing-fast RESTful search API with typo tolerance, out of the box. A single 50MB Rust binary — no database, no cache, no sidecars — with persistent storage on a Railway volume.

## Deploy and Host

Host your own Meilisearch instance on Railway. This template provisions the Meilisearch engine with a persistent volume for your index data and snapshots.

[![Deploy to Railway](https://railway.app/button.svg)](https://railway.com/deploy/meilisearch-4)

## Why Deploy

Meilisearch is the search engine behind thousands of production apps — instant results as you type, typo tolerance by default, and faceted filtering. Self-hosting it on Railway gives you:

- **Persistent index** — documents survive restarts on a Railway volume
- **Instant search** — sub-50ms responses on datasets of 100k+ documents
- **Typo tolerance** — users find results even with misspellings
- **REST API** — integrate with any language or framework
- **Single binary** — 50MB Rust, no external dependencies, minimal resource footprint
- **Search-as-a-service at $2/mo** — replace $100/mo Algolia plans

## Common Use Cases

- **RSS and article search** — index 10k+ articles and search them instantly
- **Notes and docs** — make your knowledge base searchable in milliseconds
- **Email search** — index thousands of emails with typo-tolerant recall
- **Logs** — search application logs across services
- **E-commerce** — product search with facets, filters, and sorting
- **AI agent memory** — keyword recall for agent workflows alongside a vector DB

### Deployment Dependencies

The deploy form pre-fills all required variables. No additional services needed — Meilisearch runs as a single container with a volume for persistent storage.

**After the first successful deploy:**

1. Test health: `curl https://YOUR-DOMAIN.up.railway.app/health` → `{"status":"available"}`
2. Retrieve your auto-generated master key from the `MEILI_MASTER_KEY` variable in the service settings
3. Authenticate with `Authorization: Bearer YOUR_MASTER_KEY`

## About Hosting

Meilisearch runs as a single container on Railway. Index data persists on a Railway volume at `/meili_data` (database in `/meili_data/data.ms`, snapshots and dumps created alongside). The engine listens on port 7700 and exposes a REST API. A start command derives indexer thread and memory limits from the container's cgroup so the engine stays stable on small plans, and Railway healthchecks `/health` before routing traffic.

## Features

- **Instant search** — results as you type, sub-50ms on large datasets
- **Typo tolerance** — misspellings handled out of the box
- **Faceted search** — filter and refine by attributes
- **Multi-index** — run separate indexes (rss, notes, emails, logs) in one instance
- **RESTful API** — clean JSON API, official clients for Python, JS, Rust, Go, PHP, and more
- **Snapshots and dumps** — backup and export built in
- **Single binary** — no Postgres, no Redis, nothing else to run

## Dependencies for

- **No external services required** — Meilisearch runs standalone
- **Optional: Qdrant companion** — pair with a vector database for hybrid keyword + semantic search

## Configuration

| Variable | Description | Default |
|----------|-------------|---------|
| `MEILI_ENV` | Runtime environment. Keep `production` so the API is protected by the master key. | `production` |
| `MEILI_HTTP_ADDR` | Address and port Meilisearch listens on. | `0.0.0.0:7700` |
| `MEILI_DB_PATH` | Database location inside the volume (subdirectory of the mount). | `/meili_data/data.ms` |
| `MEILI_MASTER_KEY` | Master key protecting all API routes. Auto-generated per deployment. | `${{secret(32)}}` |
| `MEILI_NO_ANALYTICS` | Disable anonymous telemetry. | `true` |
| `PORT` | Railway port target for the public domain and healthcheck. | `7700` |

## Quick Start

After deployment, the Meilisearch API is ready at your Railway public domain. Set `MEILI_KEY` to your `MEILI_MASTER_KEY` value:

```bash
export MEILI_DOMAIN=https://YOUR-DOMAIN.up.railway.app
export MEILI_KEY=YOUR_MASTER_KEY

# Health check
curl $MEILI_DOMAIN/health

# Create an index
curl -X POST $MEILI_DOMAIN/indexes \
  -H "Authorization: Bearer $MEILI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"uid":"emails","primaryKey":"id"}'

# Add documents
curl -X POST $MEILI_DOMAIN/indexes/emails/documents \
  -H "Authorization: Bearer $MEILI_KEY" \
  -H 'Content-Type: application/json' \
  -d '[{"id":1,"subject":"Kopia failed","body":"S3 backup bucket unreachable"}]'

# Search — instant, typo tolerant
curl "$MEILI_DOMAIN/indexes/emails/search?q=kopia+fail" \
  -H "Authorization: Bearer $MEILI_KEY"
```

## License

Meilisearch is licensed under the MIT License. See the [Meilisearch GitHub repository](https://github.com/meilisearch/meilisearch) for details.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/meilisearch-4
