Install Composer

Before we install Drush, we need to install globally Composer. Composer is a PHP package manager akin to NPM or Bower.

curl -sS | php
mv composer.phar /usr/local/bin/composer

Next we want to edit our .bash_profile. Go your home folder

cd ~/

Create a new .bash_profile, (don't worry, if you have one, this won't overwrite it). We need to add a global entry for Composer.

touch .bash_profile
nano .bash_profile

Add the following to your .bash_profile

$ export PATH="$HOME/.composer/vendor/bin:$PATH"

Install Drush

Now that we have composer installed globally, we can install Drush via composer.

composer global require drush/drush:dev-master

Finally, we can select a specific version. For Drupal 8, we want Drush 8.

$ composer global require drush/drush:8.*