Hello
I found a Magento developer that has some extensions which I need for my online store.
I created on Ubuntu 20.04 server, a new user "webdev01", for the Magento developer to use it to install and customize the extensions by using SSH.
1- How can I set the minimum of the folder/file permissions to the project folder and subfolders "Magento"? so the "webdev01" user can install, customize and support extensions.
2- Does "webdev01" need to be a member of the www-data group?
3- Does "webdev01" need access to the MySQL database? If yes, How can i set minimum permissions?
4- Should I edit something in the SELinux for "webdev01" users?
Please help me to do that by sending me the command line.
Thanks.
Solved! Go to Solution.
Hello @nmicro70gm7302
You need to set 775 for folders and subfolders and 664 for all type of files, and you should give 777 permission to var/ generated/ pub/static/ pub/media/
so you must run below commands to set permissions :
find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento
chmod 777 -R var/ generated/ pub/static/ pub/media/
and after installing it may require permission for env.php file:
chmod 777 app/etc/env.php
Take help from Magento DevDocs for user required permissions :
https://devdocs.magento.com/cloud/before/before-workspace-file-sys-owner.html
and for files and folders :
https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-sys-perms-over.html
Hope it helps to resolve your query.
No need to rollback anything, the folders and files should have these permission only, and the reason behind to set 777 for :
var : it stores cache files, logs etc which are generated for faster delivery and it is being created from Magento system so without this permission they can't be created.
generated : this stores all the classes from all the modules which Magento has, so this also needs to be open for permission so Magento can modify/create files inside this folder.
pub/static & pub/media : these are the files which will bring your styles/media files/script files on frontend so these are also being used by system to manipulate data inside them.
There is no harm with these permission, this is default of Magento.
Hello @nmicro70gm7302
You need to set 775 for folders and subfolders and 664 for all type of files, and you should give 777 permission to var/ generated/ pub/static/ pub/media/
so you must run below commands to set permissions :
find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento
chmod 777 -R var/ generated/ pub/static/ pub/media/
and after installing it may require permission for env.php file:
chmod 777 app/etc/env.php
Take help from Magento DevDocs for user required permissions :
https://devdocs.magento.com/cloud/before/before-workspace-file-sys-owner.html
and for files and folders :
https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-sys-perms-over.html
Hope it helps to resolve your query.
Hello,
Thanks alot for your help and your answer.
Do i need to switch back the permissions after the extension instllation?
If yes, please command line to do that.
Becuase i think the others users will have more permissions if i set 777 to var/ generated/ pub/static/ pub/media/ and app/etc/env.php
No need to rollback anything, the folders and files should have these permission only, and the reason behind to set 777 for :
var : it stores cache files, logs etc which are generated for faster delivery and it is being created from Magento system so without this permission they can't be created.
generated : this stores all the classes from all the modules which Magento has, so this also needs to be open for permission so Magento can modify/create files inside this folder.
pub/static & pub/media : these are the files which will bring your styles/media files/script files on frontend so these are also being used by system to manipulate data inside them.
There is no harm with these permission, this is default of Magento.
Thanks a lot.