Back to Blog
Tutorial9 min read2026-07-05

How to Deploy a Typesense Search Engine

Deploy Typesense, the open-source typo-tolerant search engine: container setup with persistent data, the API key model, defining a collection schema, and notes on running a high-availability cluster.

Ajay Kumar
Ajay Kumar
Founder & DevOps, PandaStack

Typesense is an open-source, typo-tolerant search engine in the same space as Meilisearch and Algolia. Its distinguishing traits are a strict, schema-first collection model and first-class support for high-availability clustering via Raft. This guide covers a solid single-node production deploy and what changes when you go multi-node.

The binary and its data

Typesense is a single C++ binary distributed as typesense/typesense. It keeps data in a directory you specify with --data-dir, and it serves on port 8108. As with any search engine, the cardinal rule is persistent storage: mount a durable volume at the data directory or you lose indexes on restart.

# launch args (set as env or command)
--data-dir=/data
--api-key=YOUR_BOOTSTRAP_KEY
--enable-cors

The bootstrap --api-key is the admin key. Like Meilisearch's master key, you don't ship it to browsers — you mint scoped keys from it.

Schema-first collections

Unlike schemaless engines, Typesense wants you to declare a collection schema up front. This is a feature: it catches type mistakes and makes faceting and sorting predictable.

curl 'https://your-app/collections' \
  -H "X-TYPESENSE-API-KEY: $ADMIN_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "products",
    "fields": [
      {"name": "title", "type": "string"},
      {"name": "price", "type": "float", "facet": true},
      {"name": "in_stock", "type": "bool"}
    ],
    "default_sorting_field": "price"
  }'

Import documents in bulk as JSONL:

curl 'https://your-app/collections/products/documents/import?action=upsert' \
  -H "X-TYPESENSE-API-KEY: $ADMIN_KEY" \
  --data-binary @products.jsonl

Scoped and search-only keys

Generate a search-only key for the frontend, optionally with embedded filters for multi-tenant isolation:

curl 'https://your-app/keys' \
  -H "X-TYPESENSE-API-KEY: $ADMIN_KEY" \
  -d '{"description":"search","actions":["documents:search"],"collections":["products"]}'

Never expose the admin key in client code.

Single-node vs HA cluster

For most apps, a single well-provisioned node is plenty. Typesense's selling point is that going highly available is built in: you run three (or five) nodes and give each a --nodes file listing peers. The cluster elects a leader via Raft and replicates writes.

ModeNodesUse when
Single1Most apps; simplest ops
HA cluster3 (or 5)Zero-downtime, fault tolerance

Honest note: running a stateful Raft cluster on any container platform requires stable network identity and per-node persistent volumes — it's meaningfully more complex than the single-node case. Start single-node, measure, and only cluster when uptime requirements demand it.

Memory sizing

Typesense holds its index in memory for speed. Provision RAM with headroom over your dataset size, and prefer a memory-optimized compute tier for larger collections. Bulk imports temporarily spike memory, so size for the peak, not the steady state.

Backups

There's no logical dump like Meilisearch; you back up by snapshotting the data directory (Typesense provides a snapshot API: POST /operations/snapshot). Schedule a snapshot on a cronjob and ship it to object storage.

References

  • [Typesense install / self-host](https://typesense.org/docs/guide/install-typesense.html)
  • [Typesense high availability](https://typesense.org/docs/guide/high-availability.html)
  • [Typesense API keys](https://typesense.org/docs/latest/api/api-keys.html)
  • [Typesense collections & schema](https://typesense.org/docs/latest/api/collections.html)

A single-node Typesense runs cleanly as a PandaStack container service with persistent storage and a memory-optimized tier, plus cronjobs for scheduled snapshots. Kick the tires on the free tier at [dashboard.pandastack.io](https://dashboard.pandastack.io).

Ready to deploy?

Start free on PandaStack.

Start free on PandaStack

More in Tutorial

Browse all Tutorial articles →

See also