WordPress Installation failed: Could not create directory.

You have to set the web server ownership :

chown -R www-data:www-data /var/www/example.com

And the directory permissions :

sudo find /var/www/example.com/ -type d -exec chmod 755 {} \;
sudo find /var/www/example.com/ -type f -exec chmod 644 {} \;