Drupal 8 – How to get Drush to run on a Linux distro

Blaine's picture
Drush is very popular in the Drupal community because it bypasses the GUI completely. Drush is a CLI tool making developing time a breeze. | Install Drush

Getting Drush to work in Linux for Drupal

Now that Drush has removed support for Pear, and running the drush.php manually is currently not working, you are “forced” to use Composer.

If you don’t follow this way, you will get an error like:
Unable to load autoload.php. Drush now requires Composer in order to install its depedencies and autoload classes. Please see README.md

If you do not currently have composer installed you will need to download and install it, see https://getcomposer.org/doc/00-intro.md for instructions.

You will need to run the following:

cd ~
curl -sS https://getcomposer.org/installer | php

Now we will set the path to .composer:

sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
Now to work with Drupal 8, you will require the latest Drush (7.x) at the time of writing this, which you can install like:

EDIT: 9/4/17 This code will pull in drush 9.x.dev
~/composer.phar global require drush/drush:dev-master --prefer-source && source ~/.bashrc

To update drush (as Drush is usually updated several times a day), simply run:

cd ~/.composer
~/composer.phar update

Recent Posts

Have you ever wanted to disable offloading of all your Xen DomU's? How about doing it without having to think... Read more
Video Website Themes It is essential to know how big the video market is. You have a well-operating platform with... Read more
How to create a marketing video that will stand above the rest The business world seems to be advancing every... Read more

Need Support?


Every video, every website, every chatbot, every client - 100% custom products and solutions to make your business run successfully

145 Pine Haven Shores Road #1205 Shelburne, VT

Socialize with us

               


Go to top