Copy and paste that link – https://getcomposer.org/composer.phar – to your browser. It’s always the latest version of Composer.
After getting it, open your terminal to test it. You need just run that command:
php ~/Downloads/composer.phar --version
I assume that you don’t want to write … every time when you need to use a composer. Let’s move it to bin directory.
cp ~/Downloads/composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
That second command makes your composer executable. Let’s try again, type that command:
composer --version