Skip to main content

How to Install Drush

Drush is a command-line utility for advanced users administering Drupal websites.

Check the compatibility chart to see which version of Drush is right for your version of Drupal.

How to install Drush (dev-master version) on GreenGeeks

  1. Request SSH access for your account.
  2. SSH to your GreenGeeks Account.
  3. Run the following commands in this order:

Go to your home directory:

cd

Create the Drush directory:

mkdir drush

Go to the Drush directory:

cd drush

Download the Drush installer:

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

Install:

./composer.phar require drush/drush:dev-master

Add the alias line to the bottom of your .bashrc file:

cd
echo "alias drush='~/drush/vendor/bin/drush'" >> .bashrc

Reload your profile:

source .bashrc

To install a specific version of Drush

In this example, we’ll install version 8. The commands that are different from the above installation steps are green.

Go to your home directory:

cd

Create the Drush directory:

mkdir drush8

Go to the Drush directory:

cd drush8

Download the Drush installer:

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

Install:

./composer.phar require "drush/drush:8.*"

Add the alias line to the bottom of your .bashrc file:

cd
echo "alias drush8='~/drush8/vendor/bin/drush'" >> .bashrc

Reload your profile:

source .bashrc

If you encounter errors installing Drush

When you run the last command, you should see Drush running correctly. However, you may encounter shell_exec errors that our support team will need to address for you.

If you have any problems installing Drush—including any shell_exec errors—please contact our support team, and we will be happy to help. Opening a support ticket in GreenGeeks is the best way to reach us.

Was this article helpful?
Need Support?
Can't find the answer you're looking for?
Contact Support

Comments

  1. disregard above post I am old and forgot how env vars work….. let tis be a less to all of you who underestimate the power of PATH!!!

  2. Great How-To and got me a working drush intall! Woot! Ran into two pieces that I’ll share in case someone else is hitting a wall.
    First: after the wget operation, the file I received was sans the trailing ‘.zip’. So I ran cp master master.zip && rm master && ls -lBoom. The master.zip is in place.
    Second issue: unzipping the ‘master.zip’ file created a drush-master/ directory which would break the chmod operation as the path is incorrect (unless I’m missing something and need to switch to decaf). If you ran the cmd I listed above check that there is a dir ‘drush/’ or ‘drush-master/’ (if you didn’t, run ls -l to check). If you got ‘drush-master/’ run cp -R drush-master/ drush/ && rm -R drush-master/ I’m a big fan of cp rather than mv as you can tell, as I have trust issues with my typing. Now you can run your chmod cmd and the rest of the How-To.

    1. Hello Jake,

      Thanks for the insight, we will certainly update the article to make these instructions clearer for everyone.

  3. For Drush 6.2, Composer is not only recommended for installation but it seems Composer is also a new dependancy even for manual installations. Folks on a Shared/Reseller account may be limited to Drush 6.1 or lower for now.

  4. Drush now requires Composer. To install it on GreenGeeks hosting, first of all you should go to your cPanel, click on “Edit php version”, and enable “phar” extention for your hosting.
    After that you should execute follow commands: (i assume you already followed instructions above and downloaded drush into ~/drush folder)

    cd
    mkdir bin
    curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
    cd drush
    php ~/bin/composer.phar install

    It will execute installation of drush library. When the script will finish his work, check drush status:
    drush core-status

    Good luck!

    1. Hello,

      Thank you for your heads up. I’ve prepared the draft update and we will insure this goes live shortly!

  5. You also may want to add information about cleaning up after the installation. You can definitely remove Drush’s master.zip file. Can you also remove Composer’s /install directory and the composer.phar file?

  6. I just installed Drush on a GG shared account. There are some problems in the given procedure. 1: Install directory is drush-master, so chmod & alias commands must reflect that. 2: Composer needs to be installed in the Drush directory. 3: This installed version 9.0-dev . I might prefer a production version. At least I know a bit more now, and can fix it if I need to.

  7. When I do this it keeps killing the php composer.phar update process. Googling says not enough RAM most likely. Everything else in the tutorial works up until the composer update process… how do I get around this? Thank you…

  8. Hello, I have the same issue, the update is always killed and I cant install composer.

    I have this :

    php composer.phar install
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
    Your requirements could not be resolved to an installable set of packages.

    Problem 1
    – Installation request for drush/drush No version set (parsed as 1.0.0) -> satisfiable by drush/drush[No version set (parsed as 1.0.0)].
    – drupal/core 8.7.x-dev conflicts with drush/drush[No version set (parsed as 1.0.0)].
    – Installation request for drupal/core 8.7.x-dev -> satisfiable by drupal/core[8.7.x-dev].

    I give the maximum memory but same issue.

    Any other way ?

    Thanks

  9. When I followed the steps in this article, I got the same problem like Saad SABER did.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.