I would like to run the official Docker Apache image as a non-root user. To make it work, it seems like it is necessary to chown the /usr/local/apache2 directory (see this and this):

chown -hR appuser:appuser /usr/local/apache2

appuser is the non-root user (group) in this case.

Originally, the files and directories in /usr/local/apache2 are owned by root. How safe is it, to give ownership of these files and directories to a normal user? Does this pose a security risk?

├── bin/
├── build/
├── cgi-bin/
├── conf/
├── error/
├── htdocs/
├── icons/
├── include/
├── logs/
└── modules/

1 Answer 1


There is no security concern running it as a non-root user that I know of. If this were my deployment I would recommend it. You will run into complications trying to use ports below 1024 as a non-root user, but that is easily remedied. I have seen the method used that you're suggesting in the question. I also found this method, which I haven't tried yet but looks promising. FYI, how you manage your Docker server is even more important. Check the CIS Docker Hardening Benchmarks for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .