$ sudo apt-get update
If this was not done before.
Install wget for file download in ubuntu
$ sudo apt-get install wget
Download the composer.phar from https://getcomposer.org/download via wget or built-in curl
$ curl -O https://getcomposer.org/composer.phar
** -O is capital O not Zero(0)
Rename composer.phar to composer
$ mv composer.phar composer
Make composer executable
$ chmod +x composer
Now composer can be run locally through
But this is available where you are i.e. current directory where the composer file is.
Make composer available globally move it to /user/local/bin by
$ sudo mv composer /usr/local/bin
Now composer will be available anywhere by simply