| Area | Owner | Permissions | Why |
|---|---|---|---|
| Core WordPress files | theekshana:www-data |
755 folders, 644 files |
So you can edit, and NGINX can read |
| Uploads folder | www-data:www-data |
755 folders, 644 files |
So WordPress can write uploads |
| Other content folders | Same as above | 755/644 |
Depends on plugin/theme needs |
Awesome, Theekshana! Since you’re the admin user with full privileges, and you're running a local WordPress project on VirtualBox Ubuntu Server, here’s a recommended strategy for setting ownership and permissions that balances:
✅ Security
✅ Ease of development
✅ Proper WordPress functionality
theekshana)Let you own the files but let the web server (NGINX) access them by setting the group to www-data.
sudo chown -R theekshana:www-data /var/www/mytestsite
This means:
theekshana) → so you can edit with VS Codewww-data → so NGINX can read files# Folders: readable & accessible
sudo find /var/www/mytestsite -type d -exec chmod 755 {} \\;
# Files: readable
sudo find /var/www/mytestsite -type f -exec chmod 644 {} \\;
Why?
755 → means: you can read/write/execute, others can read/execute (folders)644 → means: you can read/write, others can only read (files)