Steps to install Drush on Ubuntu

Wondering how to install Drush on Ubuntu? Here’s how we do it.

As a part of our Server Management Services, we help our Customers with software installations regularly.

Let us today discuss the steps to install Drush.

How to install Drush on Ubuntu?

Drush is a command-line tool for creating, administrating, and modifying Drupal websites. Install of Drush on Ubuntu involves the steps below:

  • Install dependencies
  • Composer install
  • Install Drush
  • Add Drush Directory to the Path
  • Verify the Installation of Drush

Let us look at each of these steps in detail:

Install dependencies

Let us begin the install process by updating the system.

$ sudo apt-get update && sudo apt-get upgrade

Once the system is up to date, the next step is to install the dependencies. Composer requires some PHP modules in order to run. Install them on the Ubuntu system:

$ sudo apt-get install php-xml, zip

Now, install curl in the system

apt-get install curl php7-cli git

Install Composer

The developers of Drush recommend installing Drush using Composer. We  can install it using the command below:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Install Drush

Using the following command will install the newest version of Drush, at this time it is

composer global require drush/drush

Alternatively, we can install the Drush version of our choice by appending the version needed.  For instance, use to install version 8, use the format below:

composer global require drush/drush:8

Add Drush Directory to the Path

Open the .bashrc file and input the following into the file

#path for Drush
export PATH="$HOME/.composer/vendor/bin:$PATH"

Run source show to recognize the changes to the file.

source .bashrc

Verify the Installation of Drush

We will be able to verify the version of the Drush install and other useful information by running the following command.

drush status
install drush on ubuntu

[Need any further assistance to install Drush on ubuntu? – We’re available 24*7]

Conclusion

In short, Drush install on Ubuntu involves a series of steps that include install of dependencies. Today, we saw how our Support Engineers perform this task.

We will be happy to hear your thoughts

Leave a reply

CodeROG
Logo
Compare items
  • Total (0)
Compare
0
Shopping cart