I have installed it in /usr/local/bin/composer according to the tutorial
But it can only be run locally
It won’t work in other directories
That’s not the case. You need to rename composer.phar
to composer
and then put it in /usr/local/bin
or other executable directories, and give it executable permissions.