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

Installing FFmpeg on CentOS without a lot of trouble From time to time, I have to fire up my good... Read more
Video creation 101 The video is an electronic method for recording, playback, copying, broadcasting, and display of visuals. It was... Read more
Video Marketing in the Modern World Building a well informing video takes time, talent and passion. It is time-consuming and... 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

Recent Tweets

Socialize with us


Go to top