From https://www.digitalocean.com/community/questions/how-do-i-enable-wordpress-to-update-itself-through-its-back-end
sudo chgrp -R www-data /var/www/sitename.com sudo chmod -R g+w /var/www/sitename.com find /var/www/sitename.com -type d -exec chmod g+s {} \;