Magento 2 – File and Folder Permissions Guide

magento2permissions

I would want to know which permissions i must set in the Magento2 setup and after the install.

Special mention in var/generations, that at the end i must put it in 777 or I'll never can install it.

Best Answer

Please, check the following links to set the permission properly:

http://devdocs.magento.com/guides/v2.0/install-gde/prereq/integrator_install.html http://devdocs.magento.com/guides/v2.0/install-gde/prereq/apache-user.html

Just for summary: Magento team suggest to set the file permissions to 660, the directory ones to 770. It's can be done in the following way

sudo find . -type d -exec chmod 770 {} \; && sudo find . -type f -exec chmod 660 {} \; && sudo chmod u+x bin/magento

Also, to improve the security of the site you may run your Magento instance by non-root owner. Here is helpful answers form a post with the same theme:

Magento 2 folder/file permissions

Related Topic