I have a long involved method to install composer on a shared environment, but it is now outdated in favor of the PHP .phar binary method. Composer wasn't setup to use the phar extension when I originally wrote the old article but now that the .phar method is available, it is WAAYYY easier to install.
This guide will assume you have CLI shell access through SSH. If you don't know what it is, you'll want to learn how to use it before you proceed. There's really no point in using Composer without a CLI anyway, so I'll assume you know it.
1) Navigate out to https://getcomposer.org/download/ and scroll down to the Manual Download section.
2) Right click and copy the link location
3) In the ssh terminal, navigate to your home directory bin folder ~/bin If it doesn't exist, go ahead and create it
4) Go into the ~/bin folder and issue the following command (changing the version number to whatever the latest is):
wget --no-check-certificate https://getcomposer.org/download/1.3.2/composer.phar
chmod 744 composer.phar
1) Change directories back to your home directory
2) Edit either the .bashrc file (might be .bashrc_profile file depending on your setup)
3) Create an alias to the composer.phar:
If everything went as planned, you should be able to simply issue the command composer and get the run out of commands. If you don't get the run out of commands, I may have forgotten something, or, you didn't get a step quite right...
If you use Drupal and Drush, you can either use composer to install drush, or you can follow the similar procedure to use the drush.phar file.