Example on Ubuntu
- 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
3. Add user to www-data group
adduser magedev www-data
4.Setup correct permissions
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/
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!
- 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...
- How to use plugins (interceptors) in Magento 2. Detailed guide with all the...