Setting the Correct File and Folders Permissions for Magento 2

Based on the Magento 2 Developer Documentation the following are the requirements for File & Folder permissions

  • 775 for directories, which means full control by the user, full control by the group, and enables everyone to traverse the directory. These permissions are typically required by shared hosting providers.
  • 664 for files, which means writable by the user, writable by the group, and read-only for everyone else.

To set the proper file and folder permissions log into your website hosting via SSH and run the following commands:

1) Navigate to your store root

2) Set the proper permissions for all files

3) Set proper permissions for all folders

4) Set proper permissions for the var, static and media folders

5) The last step is to ensure that after your changes that the installation is still executable for the current user

 

Hans-Eirik Hanifl

view all posts

Hans-Eirik Hanifl is a forward thinking e-commerce and marketing consultant. As an advocate for the free exchange of knowledge, he founded E-Commerce Gorilla as a place where like-minded individuals can ask questions and share their expertise on practical solutions in the area of e-commerce and marketing. He is the owner of TRM Marketing and an avid supporter of the open source community.

0 Comments Join the Conversation →


Leave a Reply

Stay in the loop!

E-Commerce Gorilla Avatar

Join the E-Commerce Gorilla e-mail newsletter. We provide monthly updates on new articles featuring all aspects of online sales and E-Commerce setup. We cover the do's and don'ts of effective online sales, along with great giveaways. As a newsletter subscriber you are automatically entered for any competitions and giveaways.* Join our community of engaged online marketing experts, great content, and great giveaways. You can't go wrong.