Loading...

Knowledge Base

How to Install Drush on a Linux Server

When you need command-line tools to manage Drupal websites on your Linux server. This article explains how to install Drush for Drupal management.

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt. Let us see the steps to install Drush and make it available for all the users in the servers. The following commands should do it.

root@domain.tld ~]# curl -sS https://getcomposer.org/installer | php

root@domain.tld ~]# mv composer.phar /usr/local/bin/composer
root@domain.tld ~]# ln -s /usr/local/bin/composer /usr/bin/composer

root@domain.tld ~]# git clone https://github.com/drush-ops/drush.git /usr/local/src/drush

root@domain.tld ~]# cd /usr/local/src/drush
root@domain.tld ~]# git checkout 7.0.0-alpha5     ? or whatever version you want.
root@domain.tld ~]# ln -s /usr/local/src/drush/drush /usr/bin/drush
root@domain.tld ~]# composer install

root@domain.tld ~]# drush --version

You may come across the following issues while executing the above commands:

1) If Drush cannot find an autoloaded class, run “composer self-update". 

2) While cloning the drush into the drush folder using git command, you may see:

root@domain.tld [~]# git clone https://github.com/drush-ops/drush.git /usr/local/src/drush
-bash: git: command not found


Just install git by typing “yum install git“. It should do the trick.