Magento 2 Pub/Static Correct File Permissions Guide

magento2

Installed a fresh Magento 2 CE and I am getting 403 permission errors on pub/static files.

I am seeing folders at 700 and files at 666.

What permissions should pub/static files and folders have?

Best Answer

In addition, the web server's group must own the Magento file system so that the Magento user (who is in the group) can share access to files with the web server user. (This includes files created by the Magento Admin or other web-based utilities.)

Magento recommend setting the permissions as follows:

  • All directories have 770 permissions. 770 permissions give full control (that is, read/write/execute) to the owner and to the group and no permissions to anyone else.
  • All files have 660 permissions. 660 permissions mean the owner and the group can read and write but other users have no permissions.

You can read more in http://devdocs.magento.com/guides/v2.0/install-gde/install/file-system-perms.html