We are working on local environments to do our developments and we don't want Magento 2 to change file permissions - actually, we think that Magento 2 should never change file permissions, it's not its responsibility to handle filesystem strategy.

How can we do that? Currently, Magento 2 keeps on updating file ownership and permissions.

  • where is magento changing you file permissions? – Philipp Sander Mar 2 '20 at 10:13
  • Anytime we execute a command using bin/magento. For example, bin/magento setup:di:compile. – Eric MORAND Mar 2 '20 at 10:45
  • You need to execute them with your webserver user – Philipp Sander Mar 2 '20 at 10:55

Magento is using the user configured in your web server (Nginx, Apache) and when executing Magento command you should also use this user.

For local development systems, it's fine IMHO to use the logged-in user.

For non-local systems you want to use a dedicated user (www-data) which is also supposed to run the cronjobs.

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.