DEV Community

Cover image for How to Install Composer on Linux - Debian
Philip Mac
Philip Mac

Posted on

1

How to Install Composer on Linux - Debian

To install Composer on Ubuntu, you can follow these steps:

Update the package list on your system:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

Install some required packages using the following command:

sudo apt install curl php-cli php-mbstring git unzip
Enter fullscreen mode Exit fullscreen mode

Download the Composer installer using the following command:

curl -sS https://getcomposer.org/installer -o composer-setup.php
Enter fullscreen mode Exit fullscreen mode

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;"
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

composer
Enter fullscreen mode Exit fullscreen mode

You should see the Composer version number and usage instructions.

That's it!Congratulation, You have successfully installed Composer on Linux - Debian.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay