I deleted the pub folder of my magento installation. Then I used

php bin/magento setup:static-content:deploy

and now the site has no CSS at all. How can I fix that?


  • Please upload pub folder files from fresh setup and run above command Commented Mar 29, 2018 at 16:08

2 Answers 2


Don't delete the entire pub folder. Delete pub/static/* if/when needed.

You are most likely missing three critical files that will not be automatically regenerated:


If you have a backup or a local dev site, I suggest finding and restoring them from there. Otherwise, you can find them in the appropriate branch of the Magento github repository (depending on what version you are running): https://github.com/magento/magento2

  • thanks saviour :) Commented Nov 19, 2020 at 9:23

Well if you have deleted pub folder then even though you run

php bin/magento setup:static-content:deploy

It will still not generate, because if its pub/static then it will generate automatically.

So better to create pub directory manually again

Then upload media folder in it from your backend.

Then run php bin/magento setup:static-content:deploy -f

It will generate static folder again and css is also load back again !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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