Permission issue for Wordpress under Ubuntu

Posted October 25, 2015 4.5k views
WordPressDigitalOcean 1-Click Apps Marketplace

I’ve done a lot of research with the post already existing, but now I need some personal advise !

I’ve set up a Wordpress with the 1-click install, imported my Wordpress site. I then followed this tutorial

I’ve check the permission on folders using the ls -l command. They are all « wp-user ». But if I check what user my wordpress run under, it’s « www-data ».

I can’t upload media via the Wordpress interface, also can’t remove certain extension… looks like a permission issue, if I change the upload folder to 777, it works. Should Wordpress run under « wp-user » instead of « www-data » ?

Thanks for your help and clear answer (i’m not a pro ! ;-))

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.

Submit an Answer
1 answer

First, I would strongly recommend not setting your permissions to 777. This is a serious security concern. The user wp-user does not exist by default on Ubuntu and is likely left over from the host you exported your site from. All your web files should be owned by www-data. Assuming your web root remains /var/www/html (the default on the WP one-click image) you can fix the ownership with:

chown -Rf www-data.www-data /var/www/html