Install Drush on Ubuntu 16.04

Cpanel/Whm License $3/mo Plesk License $10/mo Cloudlinux License $5/mo

Installing Drush provides a way of managing your Drupal installs using a familiar method, the command line.  Drush can simplify your life by allowing you to perform admin duties.

In this tutorial, we will be using Composer as our package manager, as it is necessary to install Drush’s dependencies.  It does take at least 1 GB worth of memory, so be sure to have that before starting this tutorial.

Step 1:  Updating

As a matter of good practices, we’ll update our system

apt-get update

Step 2:  Install Zip

Most likely you’ll already have the zip command but if you don’t go ahead and install.

apt-get install zip unzip

Step 3: Install Curl

apt-get install curl php7-cli git

Step 4: Install Composer

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

Step 5: Install Drush

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

composer global require drush/drush

Alternatively, you can install the Drush version of your choice by appending the version needed.  If you’d like Drush 8 use…

composer global require drush/drush:8

Step 6: Add Drush Directory to Your Path

If performing the version check in Step 6 gives you the message of “command not found” then open your .bashrc file and input the following into the file

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

Run source show recognize the changes to the file.

source .bashrc

Step 7: Verify the Installation of Drush

You’ll be able to verify the version of the Drush install and other useful information by running the following command.

drush status

Output:

PHP binary    : /usr/bin/php7.0
PHP config    : /etc/php/7.0/cli/php.ini
PHP OS        : Linux
Drush script  : /root/.composer/vendor/bin/drush
Drush version : 9.5.2
Drush temp    : /tmp
Drush configs : /root/.composer/vendor/drush/drush/drush.yml
Drupal root   : /root/.composer/vendor/drush/drush/sut

 

Related posts

World’s Second-Largest Grocer Joins IBM Food Trust Blockchain

SXI ADMIN

Stellar Investment Could Make Crypto as Easy as Chat

SXI ADMIN

UNIX Delete / Remove Directory Command

SXI ADMIN

UNIX: Remove A File With A Name Starting With – (dash) Character

SXI ADMIN

Two Charts Show How Different Bitcoin and Fiat Payments Really Are

SXI ADMIN

Banking Trade Group Proposes Database for US Bitcoin Companies

SXI ADMIN

HowTo: Use Grep Command In Unix / Linux To Search Subdirectories

SXI ADMIN

Apache Error: “semget: No space left on device”

SXI ADMIN

Bash Configure Automatic Logout [ Linux / Unix / Apple OS X ]

SXI ADMIN

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More