What are the cache directories of Magento 2.

Just I need to remove those my rm -rf command without executing Magento cache:flush command.


Either u can manually delete folders or using this command

rm -rf var/cache/ generated/code pub/static/frontend pub/static/adminhtml

After that you need to run these commands again , else the css/styles in magento frot-end and back-end won't load

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile
sudo chmod -R 777 var/ pub/ generated/
  • After remove folder, need to run setup:upgrade! why ? – Pawan Feb 28 '20 at 4:15

So Are you want to remove cache files ? If yes than remove these folders:



Simply remove this folders.


You need to remove these directories


for more information please follow this link: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/cache/partial-caching/database-caching.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.