i am beginner in Magento 2.3, and i encountred an issue when i tried to enable my first custom module: bin/magento module:enable Mageplaza_HelloWorld

I'm using docker apache container to run my Magento 2 and ubuto for OS, Can you please let me know how to change permissions inside docker apache containerThis is my issue in the image below:

enter image description here

  • Please set 777 permission to var/ pub/ and generated/ directories. and then check again Commented Nov 14, 2019 at 10:23
  • @KishanSavaliya : I can't change permissions inside my docker container : when i run chmod 777 var ==> chmod: changing permissions of 'var': Operation not permitted Commented Nov 14, 2019 at 10:38

1 Answer 1


Connect to your docker container as root and change permissions to folders var/ pub/ and generated so that php process can create/delete files it them.

docker exec -it -u root magento23_apache bash

Note: Don't run ./bin/magento from root user.

  • I connected from root user and i sat 777 permission to (var/,generated/,pub/) then changed its owner:groupe with chmod command. Thank's it works :) !!! Commented Nov 14, 2019 at 15:10

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.