DELAPARRA
Index
Color
NL
Category: CLI commands

chown

Explained by Updated

What is chown?

chown: Change Owner — Change the owner (user and group) of a file or directory. chown changes who owns a file or folder. chown www-data:www-data storage makes the web server user and group the owner. -R applies it to everything inside. Ownership and permissions work together. A web application often needs to write to a few folders, such as cache, uploads and logs. The cleanest fix is to give the web server user ownership of exactly those folders, rather than opening up permissions for everyone.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about chown

What should you keep in mind with chown?

Ownership problems are common with Docker. Files created inside a container may belong to root on your machine, and then your own editor cannot save them. Running the container as your own user ID, or setting the right user in the Dockerfile, avoids that. chown usually needs sudo, so double-check the path before running it recursively.

At a glance

CategoryCLI commands
Explained by
Updated

More CLI commands terms

All terms starting with C

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.