Linux

Where Does Typesense Store Its Data?

Typesense stores collections on disk under the data dir you pass at startup, defaulting to /var/lib/typesense on Linux packages.

Last updated

Typesense has one flag that matters for storage: the data dir. Everything indexed lands below it. Docker examples usually map a host folder to /data and pass that as the data dir. Linux packages use /var/lib/typesense instead.

The config file and the log dir sit next to it but hold no index data. If collections disappear after a reboot, the cause is almost always a data dir on ephemeral storage such as /tmp, or a Docker run without a volume. Point the flag at persistent disk and the index survives.

Where Typesense stores this, by platform

Linux
/var/lib/typesense

Package default. Config in /etc/typesense/typesense-server.ini points here. Logs sit in /var/log/typesense alongside it.

Linux
/data

Container convention from the official compose examples. Map a host folder here and pass it as the data dir flag at startup.

Frequently asked questions

How do I persist Typesense data in Docker?

Set the data dir flag to a host mounted folder such as /data in Docker. Without a mount, collections vanish when the container is replaced.

Where is the Typesense config and admin API key?

Open /etc/typesense/typesense-server.ini on DEB and RPM installs. It lists the admin key, the data dir, the log dir, and the API port in one place.

Where do Typesense logs go?

Keep it on the same volume as the data dir. Logs default to /var/log/typesense on packages and to the container stdout on Docker.

Notice an outdated path? Let us know.