How do I set permissions for uploading media in WordPress? (Ubuntu 14.04.1, nginx 1.4.6)

  • Posted on November 17, 2014
  • thinkswanAsked by thinkswan

I’m having trouble finding the correct permissions for running a WordPress site on my droplet. I followed this guide to configure the site: How To Configure Secure Updates and Installations in WordPress on Ubuntu

Configuration is as follows:

  • Ubuntu 14.04, nginx 1.4.6
  • nginx user is www-data
  • /var/www/* is owned by wp-user:wp-user
  • Directories are set to 755 and files to 644 (WordPress docs)

Secure updates and theme/plugin installations work as expected, but I receive the following error when attempting to upload new media through the web interface: Unable to create directory wp-content/uploads/2014/11. Is its parent directory writable by the server?

Any thoughts on how I can configure owners/permissions to allow this (while maintaining security)?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Updating the user/group for the php5-fpm process solved this.

In /etc/php5/fpm/pool.d/www.conf, I updated the user/group lines as follows:

user = wp-user
group = wp-user

Then I restarted the service: sudo service php5-fpm restart

Thanks to masegaloeh over at Server Fault for the helpful comment!

hello, my wordpres folder dosen’t apper and i give the right acces, if i move a website in the folder html it works … why ?

This had been driving me nuts for months! I got all kinds of crazy responses to my cries for help, but none of them did the trick until this.