So you’ve just installed and set up a new WordPress installation on your Ubuntu 16.04 server, you’ve gone to upload your first file or download a theme or plugin in the WordPress interface and …error.
If you encounter an error at this point it could be due to the incorrect ownership of the core WordPress files.
You can check this by logging into your FTP, navagating to the directory containing your WordPress installation and checking who owns the folders wp-admin, wp-content, and wp-includes. If these WordPress folders are owned by the “root” user then file ownership may be the problem.
To fix this connect to your server via SSH, navigate into the directory containing your WordPress installation and run the following command/s to change the owner of the core WordPress folders and files to the web user.
sudo chown -R www-data:www-data wp-admin && chown -R www-data:www-data wp-content && chown -R www-data:www-data wp-includes
I hope this is helpful.