Linux Operations
$ adduser username
usermod -aG sudo username
$ passwd
$ chown you:yourgroup /home -R
chmod -R ug+rw foldername
Set group of folder to www-data.
$ sudo chgrp www-data /var/www
Make it writable.
sudo chmod 775 /var/www
Set group id for subfolders.
sudo chmod g+s /var/www
Add username to the group
sudo useradd -G www-data [USERNAME]
Set folder perms for /var/www
chmod -R ugo+rwx folder