LinuxmacOS

Where Does Notmuch Store Config and Mail Index?

Notmuch config and Xapian database on Linux and macOS, plus how it maps onto your Maildir.

Last updated

Notmuch never moves your mail. It indexes a Maildir you already have and stores tags plus the Xapian database beside the mail or under home.

Config lives in ~/.notmuch-config. The database defaults to .notmuch inside the mail root. Back up tags with notmuch dump; the index itself rebuilds from mail.

Where Notmuch stores this, by platform

Linux
~/.notmuch-config

Main config (mail root, database path, user). Database defaults to [MailDir]/.notmuch/xapian/. Run notmuch new after moving mail so the index follows.

macOS
~/.notmuch-config

Same file layout via Homebrew or MacPorts. Mail often sits in ~/Maildir. Dump tags before upgrades: notmuch dump > tags.backup, then notmuch restore on the new machine.

Frequently asked questions

How do I back up Notmuch tags?

Run notmuch dump > notmuch-tags.txt and keep that file with mail backups. The Xapian index can be rebuilt with notmuch new, but tags only survive through dump and restore.

Where is the Notmuch database?

Inside your mail dir as .notmuch by default, path set by database.path in ~/.notmuch-config. Deleting it only loses index speed, not mail. Rebuild with notmuch new.

Notice an outdated path? Let us know.