Why do i need to run php bin/magento setup:static-content:deploy each time i clear the cache and also running the same command is time consuming.

I enabled apache rewrite! But still why ?

  • I had the same issue. Try to delete these folders: pub/static/frontend/<Vendor>/*, var/view_preprocessed/*, var/cache/*, then set your environment to developer with php bin/magento deploy:mode:set developer. After that Magento will create symlink as KAndy says. Sadly you have to do this each time you change a .less file in order to regenerate compiled files. Hope this help you. When you go to production you will need to set the environment to production and run setup:static-content:deploy.
    – Andrea
    Jul 31, 2016 at 17:23
  • i had enabled the developer mode, i deleted the pub static and var view folders, but i am not dealing with .less files, i change the xml files and php code and the css and js does not seem to generate properly in admin which works after i run the content deploy command.
    – Sushivam
    Aug 1, 2016 at 5:17
  • This unfortunately is happening in only one of my instances, works properly in other instance of magento2
    – Sushivam
    Aug 1, 2016 at 5:18

1 Answer 1


In development, you don't need to run setup:static-content:deploy at all. Moreover, if you run this command you will break auto update of files on page update because deploy copies files instead of creating symlink

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.