Back Up Your Configuration#
Prerequisites#
Identify which configuration file NeoMutt uses on your system.
Decide where you want your backups stored (local disk, external disk, or a private repo).
Which Files to Back Up#
Back up your main config file from the location NeoMutt is using. See Configuration File Locations.
Back up any files referenced with
:source, such as separate alias or account files.Back up user-defined files pointed to by variables such as:
$pgp_default_keyor S/MIME files if you use crypto
Expected result: all files you actively use in your configuration are captured.
Where NeoMutt Stores Data#
Some data lives outside the main config file. Check the variables that define where it is stored:
$header_cacheand$message_cachedir(cache)$history_file(command and prompt history)$certificate_file(TLS certificates)
Expected result: cache and metadata files are included if you want a full restore, or excluded if you only want configuration.
Using Version Control for Config Management#
Create a private git repository for your config files.
Add your main config file and any sourced files.
Add a
.gitignorefor transient cache files if you do not want them in version control.
Expected result: your configuration has history, and changes are trackable and reversible.
Restoring Configuration on a New Machine#
Install NeoMutt and required tools (GPG, notmuch, msmtp, etc.).
Restore your config files into the expected locations.
Verify any external paths (mail directories, token files, keyrings).
Expected result: NeoMutt starts without errors and uses your familiar settings.
Managing Config Across Multiple Machines#
Keep a shared config repo and clone it on each machine.
Use
:ifdefor environment variables to handle machine-specific differences.Store secrets outside the repo and load them dynamically.
Expected result: the same config works across systems with minimal overrides.
Sensitive Data Considerations#
Avoid storing passwords directly in config files.
Prefer
account_commandor encrypted helpers (GPG,pass, Keychain).If you must store secrets, restrict file permissions to your user.
Expected result: your backups are safe to store and sync without exposing credentials.