Linux Mint

How to Install PHP Composer on Linux Mint 21

PHP Composer is a dependency management tool used to manage project libraries written in the PHP programming language. Composer helps to install, update, and keep the complete track of PHP project dependencies. It allows the user to use these dependencies in projects and gives a standard format to manage them.

Key parameters offered by PHP Composer are:

  • Install: This command helps to install PHP required libraries from the composer.json file. Also used to install PHP repository dependencies.
  • Update: This command helps to update the PHP libraries to the latest versions from the composer.json file.
  • Remove: This command helps to delete the library from the composer.json file.
  • Require: This command helps to add library parameters in the compose.json file and download it.

Install PHP Composer on Linux Mint 21

Follow the procedural steps to install Composer on Linux Mint 21.

Step 1: Installing PHP

To install it, PHP should be installed on the system as it is a prerequisite of composer. Execute the following downloading command to let PHP install with sudo privileges:

$ sudo apt install PHP

Step 2: Downloading Composer

To download PHP composer, update the apt-cache first:

$ sudo apt update

Now execute the following command to install composer on Linux Mint 21 system:

$ sudo apt install composer

So, the PHP Composer has been installed on our Linux Mint system.

Step 3: Verify Installation

To verify the installation, type:

$ composer

How to Remove Composer from Linux Mint 21

To remove PHP Composer from Linux Mint 21, run the given-below command in command-line:

$ sudo apt remove composer


PHP Composer is the management tool to manage and create PHP projects. Some of its important parameters are install, update, remove and require. It keeps the complete track of projects written in PHP and manages them. From this article, we have learned the easiest way to download Composer on Linux Mint 21 using apt packages. We have also seen how to remove it from the system.

About the author

Syeda Wardah Batool

I am a Software Engineer Graduate and Self Motivated Linux writer. I also love to read latest Linux books. Moreover, in my free time, i love to read books on Personal development.