Download the composer.phar file
curl -sS https://getcomposer.org/installer | php
Move composer.phar to the environment variable and rename it to composer
mv composer.phar /usr/local/bin/composer
Use domestic mirror
composer config -g repo.packagist composer https://packagist.phpcomposer.com