How to install Drush 9 and Composer for Drupal 8


Installing composer on Linux system

What is composer

Composer is a tool for dependency management in PHP or Drupal 8 website. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you, Lets see how to install composer in our system globally so that all user on system can access that.

1. Firstly, Download composer using curl from your home directory

$ sudo curl -sS | php

2. Now, Move composer.phar file to bin directory

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

3. Now create a symbolic link

$ sudo ln -sf /usr/local/bin/composer /usr/bin/composer

4. To check composer

$ composer

Installing Drush 9 on Linux system

What is Drush

Drush is command line interface for drupal sites. It is a very useful tool as it helps you perform various admin tasks using just one or two commands in the terminal (like drupal core update, database update, enabling druapl module,s etc). Now lets see how to install drush 9 globally so that all users on system can access that.

1. Go to /usr/local/bin directory

$ cd /usr/local/bin

2. Download drush using composer

$ sudo composer require drush/drush:9.x

3. It will create a vendor folder in /usr/local/bin automatically

4. Now create a symbolic link

$ sudo ln -sf /usr/local/bin/vendor/drush/drush /usr/bin/drush

5. To check Drush 9

drush status


$ sudo composer require drush/drush:dev-master

We recommend to download the latest development version of drush

To download a stable version of drush you'll need to explicitly mention the version number as I did




2901 E Baltimore St, Baltimore, MD 21224

Contact us