BE SOCIAL & SHARE:

Updated: June 23rd 2014.

Drush is a command line utility for administering Drupal websites, For advanced users, drush makes managing your Drupal website more efficient. Version 5 of Drush can administer Drupal versions 6, 7 and 8.. Installing Drush is easy on GreenGeeks by following these steps:

Step 1: Request SSH access for your account.

You can request access for SSH by following our tutorial. 

Step 2: SSH to your GreenGeeks Account

Step 3: Go to the Drush page and copy the link address for the version you would like.

Step 4: Run the following commands in order:

Navigate to your home directory:

cd

Download the Drush tar:

wget https://github.com/drush-ops/drush/archive/master.zip

Extract the tar:

unzip master.zip

Remove the file:

rm master.zip

Correct the permissions on the file:

chmod u+x drush/drush

Create the drush alias by editing your .bashrc file in your home directory:

nano ~/.bashrc -or- vim ~/.bashrc

add the following line to the bottom of your .bashrc file.

alias drush='~/drush/drush'

Reload your profile:

source ~/.bashrc

Test to see if it works:

drush core-status

Installing/Configuring Composer:

You may be prompted to install Composer during the installation of Drush. Composer is used to handle modules/packages for Drush maintenance. To install an additional step is required:

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

I’m encountering errors installing Drush!

When you enter the last command, you should see Drush running properly. However, you may encounter shell_exec errors which 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 would be happy to help. Opening a support ticket in your Account Manager is the best way to reach us.

About The Author

Comments

  1. Shane Roberson

    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. Jake

    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.

  3. Josh Dargie - GreenGeeks Article Author

    Hello Jake,

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

  4. Chris Charlton

    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.

  5. Nikita Petrov

    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!

  6. Josh Dargie - GreenGeeks Article Author

    Hello,

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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>