Clarification please: write permissions /usr/share/nginx/www

  • Posted December 15, 2013


I get so frustrated with the lack of my knowledge ;)

I’m setting up a new droplet. Nginx is installed and the “Welcome to nginx!” shows in the browser. PHP is also working as well as mysql and phpmyadmin.

Now, I connected sftp using filezilla with a username and tried to upload a file. The file would not upload and the error:

Error: /usr/share/nginx/www/installer.php: open for write: permission denied

Now this makes sense because root is the owner. I recall issues (and did searches) that WordPress will not update unless the correct ownership is provided. Sadly, answers are a bit cryptic.

I tried:

chgrp www-data /usr/share/nginx/www chmod g+w /usr/share/nginx/www

This did not work.

Also, I know that there must be a way to add permissions to the “myuser” account so that I can transfer files AND have WordPress update.

Thank you for the clarification.


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

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.

Hi Kamal, Hope you can help me, I have the same problem I don’t have writing permissions to update some files on wordpress using Winscp, I’ve followed this tutorial to install wordpress “” and works fine. I’ve installed wordpress under “/usr/share/nginx/wpdir”, when I try to run as you mention “sudo usermod -a -G wpdir myuser” I get the message “group ‘wpdir’ does not exist”.

I have no user root instead I’ve created a new user “myuser” with sudo rights following this tutorial:

I have another question: why it is important to move wordpress from: “/usr/share/nginx/wpdir” to “/var/www”


What user is php5-fpm running as? <br><pre>sudo ps wwaux | grep php5-fpm</pre>

Thank you but I have a couple of questions for clarification. <br> <br>First, there is no “wordpress” user or group. I temporarily used www-data. <br> <br>Second, I moved the files to /var/www and updated the nginx config file. <br> <br>I’m still not able to update WordPress in wp-admin panel. :(

Your user does not have access to write to /usr/share/nginx/www. <br> <br>You also shouldn’t store your websites in /usr/share/nginx/www. Instead, store them in /var/www and edit nginx to serve the files from that directory: <br><pre>sudo mkdir /var/www <br>sudo chown wordpress. /var/www <br>mv /usr/share/nginx/www/* /var/www <br>mv /usr/share/nginx/www/.* /var/www</pre> <br> <br>Add your user to the wordpress group: <br><pre>sudo usermod -a -G wordpress youruser</pre> <br>Then allow group write to /var/www: <br><pre>sudo chgrp -R wordpress /var/www <br>sudo chmod -R g+w /var/www</pre>