How to Install Composer on Linux - Debian
Philip Mac
Posted on April 13, 2023
To install Composer on Ubuntu, you can follow these steps:
Update the package list on your system:
sudo apt update
Install some required packages using the following command:
sudo apt install curl php-cli php-mbstring git unzip
Download the Composer installer using the following command:
curl -sS https://getcomposer.org/installer -o composer-setup.php
Verify the downloaded installer:
HASH=`curl -sS https://composer.github.io/installer.sig`
echo $HASH
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
You should see the message "Installer verified" if everything is okay.
Run the installer:
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Verify the installation:
composer
You should see the Composer version number and usage instructions.
That's it!Congratulation, You have successfully installed Composer on Linux - Debian.
💖 💪 🙅 🚩
Philip Mac
Posted on April 13, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.