Set up Valkey or Redis for Magento 2, cache and sessions.
Move Magento's cache and sessions out of files and into Valkey or Redis: one command each, in separate databases, then check and flush the right one. Checked on Nov 5, 2026.
The latest Magento patches list Valkey 8.1, the open-source fork of Redis. Magento talks to both in the same way, so the commands below work for either.
On your server
valkey-cli ping # or: redis-cli ping
valkey-cli INFO server | grep version
PONG means the server answers.
Step 2Cache
Send the default cache to database 0
Configuration, layouts, blocks and translations are cached here. One command writes the settings to app/etc/env.php.
Sessions in Valkey or Redis are faster than files and work across several web servers. Keep them in their own database, so flushing the cache never logs customers out.
Either. Valkey is the open-source fork of Redis and the version Adobe lists for the latest Magento patches. Magento's configuration is the same for both.
So you can flush the cache without emptying sessions, and see at a glance how big each one is.
In app/etc/env.php, under cache and session. The setup:config:set commands write them for you.
Yes. Cache and sessions run in their own databases on every Magento plan.
Bring your store over. We move it for free.
Pick a plan, pick a platform, and your store is online before the coffee cools.