WordPress File Folder Permission Chown in SSH

When installing a wordpress site in a VPS server, usually there is a problem with folder and file permission. You may successfully install wordpress, but you may face permission problem. When you cannot:

  • add new wp theme
  • add new wp plugin
  • update wp theme
  • update wp plugin
  • upload image

Then there may be a problem with folder and file permission.

I’m not really sure about the real problem, but it usually happens to me, so here is my solution.

First, login to your server through ssh as root. Then,

run the following script, just edit, copy and paste:

chown -R www-data:www-data /var/www/yoursite.com/public_html/

if your wordpress is installed in a sub folder, then:

chown -R www-data:www-data /var/www/yoursite.com/public_html/subfoldername

once you change it to your domain name or subfolder name, copy paste into terminal and press enter.

The permission will be granted and you can update/add theme/plugin.

Thanks, hopefully that will help.

Leave a Reply