Nexcess Logo

How to flush Redis from CLI in Magento

Knowledge Base Home

Notice anything different?

We've enhanced the appearance of our portal and we're working on updating screenshots. Things might look different, but the functionality remains the same.
September 11, 2019

Redis is commonly used on Magento stores for object caching and page caching.


To be able to clear Redis from CLI, you will need to make sure that SSH is enabled if you have your Magento store on a non-cloud server. If you have a Magento cloud server, then you can find the SSH credentials from the portal of your site.


CAUTION: Use caution when performing this operation since data will be cleared related to object and page caching on your site. If you are a Nexcess client, we recommend discussing other options with our support team before flushing your Redis database. You may contact them by email or through your Client Portal.


Identify the Redis connection details in the configuration file of your Magento store. If you need help locating this file, then please contact our support team.


Flush your cache using one of the below commands, but replace the angled brackets (<>) and everything between them with the indicated information that has been provided by support. If the first path is invalid, try the second. The correct path depends on your server type and various other factors.

Flush your cache using one of the below commands, but replace the angled brackets (<>) and everything between them with the indicated information. If the first path is invalid, try the second. The correct path depends on your server type and various other factors.

redis-cli -s /var/tmp/redis-multi_<customer_specific_name>_cache.sock flushall


redis-cli -s /var/tmp/redis-multi_<customer_specific_name>_cache.sock flushall async


redis-cli -s /var/tmp/redis-multi_<customer_specific_name>_cache.sock -n <db number> flushdb


redis-cli -s /var/tmp/redis-multi_<customer_specific_name>_cache.sock -n <db number> flushdb async


The Redis CLI will make clearing the Redis caching on your Magento store fast.

For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

Jason Dobry
We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.