Example on Ubuntu
Assumptions:
- Apache is run as user www-data and group www-data.
- Magento root folder is /var/www/magento2
- User name – magedev
In this example, we will use server with apache2
1. Log into server as the root user
2. Create new user which will own files and will be added to server (for example Apache or Nginx) group
Shell
1 | adduser magedev |
3. Add user to www-data group
Shell
1 | adduser magedev www-data |
4.Setup correct permissions
Shell
1 2 3 4 5 6 7 8 9 | cd /var/www/ chown -R magedev:www-data magento2/ setfacl -Rm u:magedev:rwX magento2/ setfacl -Rm d:u:magedev:rwX magento2/ setfacl -Rm g:www-data:rwX magento2/ setfacl -Rm d:g:www-data:rwX magento2/ cd magento2/ chmod -R 777 var chmod -R 777 pub/static |
5. Work as magedev user with Magento on server
Install Magento File Permissions correctly and easily!
Valentyn KubrakChief Operating Officer
Rate us
Please wait...
Related articles
- If you don’t know how to create a custom cache type in Magento, this article...
- Do you know how to create custom product type? We know! And would be glad to...
- Want to use the latest trend Progressive Web Apps? Read how to install PWA on...
- Create CMS page for Magento 2 programmatically and without...
- Do you follow all the Magento code standards? Know more about them with a help...
- How to create Admin Grid in Magento 2: read our detailed...
- It is important to clear cache on the Magento 2 store. If you are not sure how...
- Do you know how to install Magento 2? Read our guide and be sure that...