So I've set up a Wordpress site on my server. The problem I'm having is that Wordpress creates new folders to sort content uploaded from the Dashboard by day. But, somehow the server doesn't have permission to create new folders. How can I set the permissions so that the server will have full creation/read/write permissions in the directory?

Also, how can I set it so that the server will automatically have the same permissions over any future subdirectories created in Wordpresses's folder?

  • Show some example output, who owns the directory what permissions (ls -l) ? what user does your webserver run as ? what have you tried ? help us out a bit here.
    – X Tian
    Feb 21, 2014 at 2:48
  • One thing you can do is create a wordpress user and put everything in its $HOME.
    – Ketan
    Feb 21, 2014 at 2:52
  • Making a wordpress user can be tricky if you're using Apache, since this service is typically already setup in most distros to be operated as user apache.
    – slm
    Feb 21, 2014 at 2:57

1 Answer 1


The easiest way to accomplish what you want is to setup the directory where Wordpress was installed like so:

$ chmod u+rwx,g+rwxs,o-rwx wordpress
$ chown apache.apache wordpress

The above will make sure that any new files or directories that are created under wordpress are always accessible by group apache. You'll want to substitute whatever user/group is being used on your system here. Some distros use user/group www-data instead.

To repair any existing directories + files you can use these commands to do that.


$ find wordpress -type d -exec chmod ug+rwx,g+s,o-rwx {} \;
$ find wordpress -type f -exec chmod ug+rw,o-rwx {} \;


$ chown -Rf apache.apache wordpress

NOTE: Again you'll want to use your user/group in the chown command above. www-data & www-data are often used on some Linux distros' Apache packages.


  • Running the second line, I got an error saying invalid user apache.apache. Was apache supposed to create its own user on my system?
    – evamvid
    Feb 21, 2014 at 3:03
  • Never mind, I ran the same command using user www-data after reading this question, and it worked! Thanks!
    – evamvid
    Feb 21, 2014 at 3:11
  • Oh noes! now when I go visit the page from a browser, I get a server error on the main page and a forbidden message (you don't have permission to access) when I go to the wp-admin page. What do I do? I guess I need general read access. Right?
    – evamvid
    Feb 21, 2014 at 3:14
  • Never mind again - I ran sudo chown -Rf www-data * in the wordpress directory after reading this and this.
    – evamvid
    Feb 21, 2014 at 4:42

You must log in to answer this question.

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