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

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.

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!

  7. Josh Dargie - GreenGeeks Article Author

    Hello Chris,

    Thank you for your comment. We are in the progress of updating this article :).

  8. jim randell

    Great help Nikita, only a few issues when I try.
    first,

    I don’t see that on cPanel, I see of three options for PHP, none offer the ability to enable to phar extension (that I could see).

    moving on, the curl command seemed to work, but with this response – note the warning:
    “curl -sS https://getcomposer.org/installer | php — –install-dir=bin
    #!/usr/bin/env php
    Some settings on your machine may cause stability issues with Composer.
    If you encounter issues, try to change the following:

    PHP was compiled with –with-curlwrappers which will cause issues with HTTP authentication and GitHub.
    Recompile it without this flag if possible

    Downloading…

    Composer successfully installed to: /home/woodwar1/bin/composer.phar”

    OK, moving on,
    I get a successful install from “php ~/bin/composer.phar install”, but also alerts to suggested installs (dependencies?)

    “pear/console_table suggests installing pear/Console_Color (>=0.0.4)
    d11wtq/boris suggests installing ext-readline (*)
    d11wtq/boris suggests installing ext-pcntl (*)
    phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
    phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)”

    the last response I get is encouraging:
    “Generating autoload files
    XXXXXXXXXX@server25 [~/drush]# ”

    so, with warnings: I am going to proceed, and see where it gets me.

    -Jim

  9. jim randell

    Sorry, should have add:

    XXXXXXXXX@server25 [~/drush]# drush core-status
    PHP executable : /usr/bin/php-cli
    PHP configuration : /usr/local/lib/php.ini
    PHP OS : Linux
    Drush version : 7.0-dev
    Drush temp directory : /tmp
    Drush configuration :
    Drush alias files :

    so, not sure the status is indicating everything is hunky dory, but, I will proceed.

    -Jim

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>