I have install and configured magento 2 in ubantu 18.04. Everything work fine but when i am run magento2 command using cli than every time it will display file permission issue in "cache_dir" and "generated" folder.

I am try to give permission using this link Permission solution

But no luck.

  • you local user and the webserver user should be in a group together. and the magento folder should be owned by that group Dec 18, 2018 at 9:35

1 Answer 1


umask feature is specially made of new files permission.

default umask in magento2 is 002
If you want to change it then just create a file name magento_umask and put your value in it.

For more information you can check

  • 1
    I am create one file "magento_umask" and put value 002 and store in root and after that i am deploy my project and same issue arrive. Dec 18, 2018 at 8:51
  • make sure you have setuped magento user in correct way also the files ownership and group permissions are correct. and never run magento commands through sudo or root user. Dec 18, 2018 at 9:05
  • 1
    I have run command 2 times using sudo(root), So if i am remove this magento 2 setup folder and make new one and install new setup and run command without sudo than it will resolve this issue ? Dec 18, 2018 at 9:47
  • create one user for magento and run commands through magento user. devdocs.magento.com/guides/v2.1/install-gde/prereq/… Dec 18, 2018 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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