Install Composer on CentOS 7

Since Composer will become a useful tool to manage Drupal 8 site, it would make sense to install this on your server.

I am using CentOS 7.2 for my web hosting server so will cover how to install it under this Linux distro.

If you run the popular Ubuntu Linux, check out this guide

Composer is a 3rd party tool for dependency management in PHP but can be used to manage Drupal 8 modules and etc.

To install, open up a terminal and SSH to your server:

Change to /tmp directory

cd /tmp

Download the composer.phar file using this command:

curl -sS | php

Move composer.phar to /usr/local/bin/, using this command:

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

Now you should be able to use the command composer globally.

To test your installation, run:


Composer uses to find open source libraries to manage and install.

You can also install Drush using Composer easily. Be sure to install Drush 8.x because this is the version with Drupal 8 support (i use it for Drupal 7 as well so no need to install multiple version of Drush).