Linux

Where Does Redis Store Data Files?

Redis config file and persistence files (dump.rdb, appendonlydir) on Linux, plus how dir and dbfilename redirect them.

Last updated

Redis reads redis.conf for everything, including where persistence files go. Defaults put dumps in /var/lib/redis, but dir and dbfilename directives move them freely.

Always ask the running server where it writes. Two config lookups beat every assumption about distro packaging.

Where Redis stores this, by platform

Linux
/etc/redis/redis.conf

Defines dir, dbfilename and appendonly settings. Confirm live values with CONFIG GET dir rather than trusting the file alone.

Linux
/var/lib/redis/dump.rdb

Default home of dump.rdb and the appendonlydir folder. Redis user must own these files; permission errors after restores are usually ownership.

Frequently asked questions

Can the dump file live outside /var/lib/redis?

Yes, ifdir points elsewhere in redis.conf. Run CONFIG GET dir and CONFIG GET dbfilename against the live server; those values beat any documented default.

How do I migrate Redis data to a new server?

Copy dump.rdb (and the appendonlydir contents when AOF is on) with Redis stopped, then start the new instance against them. Mixed RDB+AOF setups need both parts.

Notice an outdated path? Let us know.