I've seen a couple of solutions on this site that solved some permission problems, however, they seem that they create others, at least for me. My setup is a local wordpress installation on Ubuntu 14.04.

For example: when I want to install a plugin from within my wordpress admin area, I used to get asked to enter my FTP details. Surfing for an answer, I found that changing your user:group to www-data:www-data would solve it, and indeed it did.

However, upon making that change, my files stopped being writable from any editor. I tried adding my current user name nasser to the www-data group (I did this with sudo adduser nasser www-data) and even changed all of my file permissions to 775, but to no avail.

So now, I'm switching back and forth between owners/groups if I want to add a plugin or theme while editing. I could settle for simply downloading a plugin/theme and unzipping it manually into wp-content/plugins or /themes Even unzipping a theme/plugin and manually copying it to the appropriate location would require a permission change.

Any help would be much appreciated. If I missed any details, or was unclear, please let me know.


1 Answer 1


I'm too working on Ubuntu, personally I'm setting things up like this:

sudo chown -R nasser /path/to/your/wordpress/root/
sudo chgrp -R www-data /path/to/your/wordpress/root/
sudo chmod -R 775 /path/to/your/wordpress/root/

I only do this on my local development machine for convenience and a smoother work-flow. One more thing to note, I've moved the www directory into the home directory, symlinking from /var/www/ to /home/user/www/, which is convenient, but shouldn't be necessary.

Do not forget to revert this back before deploying, for this do at the very least this:

sudo chown -R www-data /path/to/your/wordpress/root/
sudo chgrp -R www-data /path/to/your/wordpress/root/
// the last two lines can be combined like:
// sudo chown -R www-data:www-data /path/to/your/wordpress/root/
sudo find /path/to/your/wordpress/root/ -type f -print0 | xargs -0 sudo chmod 644
// the last line could also be done like this:
// sudo find /path/to/your/wordpress/root/ -type f -exec chmod {} 644 \;
sudo find /path/to/your/wordpress/root/ -type d -print0 | xargs -0 sudo chmod 755
// the last line could also be done like this:
// sudo find /path/to/your/wordpress/root/ -type d -exec chmod {} 755 \;
sudo chmod 600 /path/to/your/wordpress/root/wp-config.php

You might of course have other wishes for your file permissions, more about that in the codex articles Changing File Permissions and Hardening WordPress - File Permissions.

  • With these settings you cannot update plugins via wp-admin due to ftp connection notice. You must use a group and user www-data. Some say "Solved!" but the problem is that when you later create files on your server, these files are not created like www-data, but as the user you are logged in to
    – kanlukasz
    Aug 12, 2020 at 6:36
  • @kanlukasz I stated in my answer that you have to change it back for the deployment on the server. Aug 12, 2020 at 11:04
  • Yes, of course, but in the development environment, you may also want to update your plugins and you can't. Of course we can do this with wp-cli, but that's another story.
    – kanlukasz
    Aug 13, 2020 at 6:12

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.