How to Install Drush 8 on Ubuntu 18.04 (LTS)

Posted March 19, 2020 in Tech

The quick and dirty installation process

Install composer if you haven’t already.

curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer

If you haven’t already, be sure to add composer/vendor/bin to your PATH

This may be different on your system. This however was the path I had to include on my Ubuntu 18.04 (LTS) install.

echo '' >> ~/.bashrc
echo '# Include Composer Installs in PATH' >> ~/.bashrc
echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc

Install cgr

A safer alternative to composer global require

composer global require consolidation/cgr

Install Drush 8.

cgr drush/drush:8.x-dev --prefer-source

Finally, test!

drush status

You should see your version of drush along with some other data if everything is working.


Using this method will help resolve the common error: count(): Parameter must be an array or an object that implements Countable Table.php:789

© 2020 - Josh Sommers