LinuxmacOS

Where Does Redis Store dump.rdb?

Redis writes dump.rdb and append-only files into its working dir. How to find the real dir and the usual Linux default.

Last updated

Redis stores snapshots in the file named by dbfilename, inside the directory named by dir. Defaults are dump.rdb and ./, which means the snapshot lands next to wherever you started the server. Package installs pin this down.

On Debian and Ubuntu the shipped redis.conf sets dir to /var/lib/redis, so the snapshot is /var/lib/redis/dump.rdb. Homebrew on macOS tends to use /usr/local/var/db/redis or /opt/homebrew/var/db/redis. The append-only file, when enabled, sits in that same directory.

Where Redis stores this, by platform

Linux
/var/lib/redis/dump.rdb

Set by the dir line in /etc/redis/redis.conf (often /var/lib/redis). The folder should be owned by the redis user. Run CONFIG GET dir inside redis-cli to confirm the live value.

macOS
/usr/local/var/db/redis/dump.rdb

Homebrew path varies by chip generation. Check CONFIG GET dir since Cellar layouts change. The redis.conf template lives under the Homebrew etc directory.

Frequently asked questions

how do i find where redis saves dump.rdb

Run redis-cli and type CONFIG GET dir, then CONFIG GET dbfilename. The two answers combine into the full snapshot path. This beats guessing because the dir setting varies by distro and install method.

can i copy dump.rdb for a backup

Stop writes or run BGSAVE first, then copy dump.rdb plus any appendonly files. Copying mid-save can leave you with a half written file. The config file itself (/etc/redis/redis.conf) is worth backing up too.

Notice an outdated path? Let us know.