Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

1: Composer does not have a .deb so a manual install is required. The first step, if you haven’t already, is installing PHP. This setup will fail if PHP is not installed. You can install PHP by running the following command:

sudo apt install php

2: While on your home folder on the terminal create a file for the script.


3: Open this file with your favorite editor, for this example, I’ve used nano.


4: Paste the following script in, save and exit nano.

php -r "copy('', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")</pre>
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1

php composer-setup.php --quiet
rm composer-setup.php
exit $RESULT

5: Make the script executable:

 sudo chmod +x

6: Run the file:

sudo ./

No output means it all went ok and it has created a composer.phar file in the same directory.

7: Now, move composer.phar to mkae it available anywhere within the system:

sudo mv composer.phar /usr/local/bin/composer

8: You can now test the install by invoking it anywhere by simply running the command


That’s it, you’re done! You can visit the official website by clicking here.