I am running Magento 2 locally in developer mode

After installing i would not expect to have to run php bin/magento setup:static-content:deploy if in developer mode.

However, the only directory under static is _requirejs and all css and other assets generate a 404 on the frontend.

Is the php bin/magento setup:static-content:deploy command required even in developer mode or do i have an issue with this?

3 Answers 3


If you are in Apache:

  1. Check you have the correct .htaccess file under pub/static folder https://github.com/magento/magento2/blob/2.2/pub/static/.htaccess. Check https://github.com/magento/magento2/blob/2.2/pub/static/.htaccess#L21 which redirects requests to static.php
  2. Make sure your mod rewrite module is working properly.
  3. Make sure apache is reading .htaccess files.

Apache 2.2 AllowOverride All Order allow,deny Allow from all

Apache 2.4 AllowOverride All Require all granted

If you are in Nginx:

Update configurations using https://github.com/magento/magento2/blob/2.2/nginx.conf.sample. Check https://github.com/magento/magento2/blob/2.2/nginx.conf.sample#L111 which redirects requests to static.php


Also, if you are running Apache: make sure that mod_rewrite module is enabled.


If you are running Magento on Windows perhaps try this solution (German), we had to change the file \vendor\magento\framework\App\StaticResource.php due to dirctory separator issues.

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.