I am really really new to Magento 2 so forgive my lack of knowledge.

I am reading the Magento documentation and I keep seeing Magento file system owner.

E.g. sudo -u Magento_file_system_owner command

Problem is, I don't really understand what this user is or how to create it. I've tried to research online, but couldn't really find a clear explanation on how to create a Magento file system owner.

Any help/guidance is very much appreciated!

3 Answers 3


That command means you should run the command using the user that owns the Magento files/folders. This user can vary but you should be able to position yourself in the document root and run ls -l or ll and get an output like this

enter image description here

where sjengle (the string in the 3rd column) is the owner of the file and hence, Magento_file_system_owner in your case.


If you were told a user name to log in to your system by a hosting provider, you are probably need to set one-user permissions as that user. In the event of a one-user setup, the same user owns the Magento files. That user grants write permissions to all others on the system (notably, the web server, who typically runs as nobody).

If, however, you can log in to your server as root or can sudo to root and create other users, you should create a local Magento file system owner user and make that user the owner of the files in the Magento file system. That user shares ownership with the web server by virtue of a group to which both users belong.


In order to ensure proper file system ownership and permissions for a Magento installation on Ubuntu, it is recommended to follow these steps:

Identify the user that your web server (e.g., Apache or Nginx) runs as. This can typically be found in the configuration files for your web server.

Change the ownership of the Magento files and directories to the web server user. This can be done using the chown command. For example, if the web server user is www-data, you can run the following command from your Magento root directory:

kotlin Copy code

sudo chown -R www-data:www-data .

Change the permissions of the directories to enable proper read, write, and execute access. You can use the chmod command for this purpose. For example, you can set the permissions as follows:

bash Copy code

sudo find . -type d -exec chmod 755 {} \;

Change the permissions of the files to ensure they are readable. You can use the chmod command for this purpose as well. For example, you can set the permissions as follows:

bash Copy code

sudo find . -type f -exec chmod 644 {} \;

By following these steps, you should be able to set the correct file system ownership and permissions for Magento on Ubuntu. It's important to ensure that the web server user has the necessary permissions to read and write files and directories in order for Magento to function properly.

Please note that the specific commands and ownership/permissions may vary depending on your server setup and the user running the web server. It's always a good idea to consult the official Magento documentation or seek assistance from the Magento community for more detailed and up-to-date information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.