WordPress plugin install: Could not create directory

Solution:1

You only need to change the access permissions for your WordPress Directory:

chown -R www-data:www-data your-wordpress-directory

Solution:2

You can fix this by using the following commands. You should first be in the root folder of WordPress.

sudo chown -R www-data:www-data wp-content/plugins/
sudo chmod 775 wp-content

sudo chown -R www-data:www-data wp-content/