Hopefully this helps solve your problem and explain whats going on, to help you in the future too.
When you go into the wordpress "dashboard" and upload files - the "user" that is performing the changes to the filesystem is
www-data (i.e. libapache2-mod-php5 via apache webserver).
Therefore in order to make changes in
www-data needs to either have write permissions to the directory or own the directory.
This means you can either give the folder liberal permissions by running:
chmod -R 777 wp-content/uploads
Note: you will have to
cd into the wordpress directory first, and if you dont currently own the folder, you will need to use
However in my experience, this will result in problems , i.e. once you fix that permission issue, you will likely run into more problems when wordpress tries to write files to other directories e.g. when it updates, new plugins etc. so in that case i would use:
sudo chown -R www-data <wordpress-parent-directory>
www-data own the entire folder.
Note: its not such a big deal on local install but when you move to production server, need to be careful with permissions, and generally only give webserver absolute minimum permissions it needs to do its job.