Last updated 2 May 2017. Created on 27 October 2015.
Edited by akashkrishnan, add1sun, asauterChicago, yaworsk. Log in to edit this page.

Quick video tutorial on how to set up drush for drupal 8. This covers both windows and linux.

Non-video tutorials

Directions are available on Drupalize.me. Which can be found here: Upgrading Drush to work with Drupal 8-dev

For the most up-to-date information on upgrading Drush for Drupal 8 read the official documentation Here on Drush.org

Manually upgrading if using Linux or Mac OSX (using official documentation)

This tutorial assumes you are comfortable working in the terminal and assumes a basic understanding of file structures. This is likely the most fool proof method to ensure Drush is updated to the latest version, while also preserving your old copy if you need to rollback or switch versions for an older site

Determine the latest version for your server using the Drush compatibility chart

If you are sure you want to the latest version, you can follow these steps:

  • Open a terminal window and type:
    cd ~/
  • Download the latest version:

    php -r "readfile('http://files.drush.org/drush.phar');" > drush
  • Make the new version executable:
    sudo chmod +x ~/drush
  • **Important** Depending on your setup, you need to find the path of your current install by typing:
    which drush
    This will return something typically like "/usr/bin/local". However depending if you used a package manager or your system the path could be different.
  • **Important** make sure you have copied this path before continuing, all the next steps require it
  • Using the path found above, make a backup copy of drush
    sudo cp /yourpath/to/install/drush /yourpath/to/install/drush_old
  • Delete the old version: sudo rm /yourpath/to/install/drush
  • Move the new version to your install path:
    sudo mv ~/drush /yourpath/to/install/drush
  • Initialize the new version
    /yourpath/to/install/drush init
  • It may ask if you want to append some Drush bash customizations. Most people do and I would assume you would choose yes.
  • Now you should be able to navigate to a Drupal 8 site root and test with simply typing "drush". If all goes well you'll see a list of commands available for that site.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

zydoon’s picture

un Linux, at least Red Hat/Fedora based, the PATH variable include $HOME/bin, so in first step, one can do cd ~/bin and download drush there.