Magento 2How To GuideDecember 4, 2020

[Fixed] Magento 2: You Don't Have Permission to Access / on this Server

[Fixed] Magento 2: You Don't Have Permission to Access / on this Server
When working with Magento 2, you may get an error with the following message. Forbidden You don’t have permission to access / on this server.

In this tutorial, I’ll show you the main reason behind this error and a proven & tested method to fix the Magento 2 error “You don’t have permission to access / on this server.”

Cause of the Error:

This issue indicates that permission settings of your server are incorrect. Issues related to Ownership, Groups, and Permissions are common in Magento.

Solution:

To fix this issue, understand the following two default server permissions used for Magento 2 files and folders.
  • 775 for directories. It gives full control for the user and the group.
  • 664 for files. It gives the write permission for the user and the group and read-only for everyone else.

Grant Permissions:

So use the following command to grant permissions to the Magento 2 folder that will prevent the error “You don’t have permission to access / on this server”.

sudo chmod 755 /path/to/your/magento2

Refer to the official guidelines for more information related to permissions in Magento 2.

Related Posts: