Installing Drush on a MediaTemple (gs) Grid-Service Account

[box type=”note”]Unless you are using MediaTemple, you should try the directions to install Drush using Pear on a shared host first, as that method is preferred.[/box]

A while back I wrote a quick guide for getting Drush up and running on a shared Dreamhost account and it was great to see lots of folks taking advantage of the power of Drush on a more commodity (read: cheap) host. But what if you’re running on a slightly more expensive and more featured host like MediaTemple’s grid offering? Well; you can run Drush there too, and I’ll show you how.

First off, we’re going the more manual route this time since I’ve had more success with it on MT. So head on over to the Drush project page and copy the latest tar.gz version of Drush to your clipboard. Then, log into your MT (gs) instance (or just run the command `cd` if you already have an SSH session open to your (gs) already) and create a directory called bin in your home directory and enter it:

mkdir ~/bin
cd ~/bin/

Next, download and extract the tarball of Drush you copied earlier:

tar xvpfz drush-*.tar.gz

Now, make a new folder in your home directory called .drush and enter it:

mkdir ~/.drush
cd ~/.drush/

Because of the more tightened security on the default CLI version of PHP MediaTemple provides we’re going to need to override some configuration values to suit us. In the ~/.drush/ directory make a file named drush.ini and place in it the following values (I prefer to use nano drush.ini for this):

memory_limit = 128M
error_reporting = E_ALL | E_NOTICE | E_STRICT
display_errors = stderr
safe_mode =
open_basedir =
disable_functions =
disable_classes =

Lastly, we need to add Drush into our path and reload the BASH configuration:

echo "export PATH=\"~/bin/drush\:$PATH\"" >> ~/.bash_profile
source ~/.bash_profile

That’s it! You now have a fully working Drush on MediaTemple; get out there and `drush up`. Go on, I know you want to 🙂


tl;dr: Install the latest 5.x-dev Drush on your (gs) by running this long command, or replace the highlighted tar.gz with the version you want:
mkdir ~/bin;cd ~/bin/;wget;tar xvpfz drush-*.tar.gz;mkdir ~/.drush;cd ~/.drush/;echo -e "memory_limit = 128M\nerror_reporting = E_ALL | E_NOTICE | E_STRICT\ndisplay_errors = stderr\nsafe_mode =\nopen_basedir =\ndisable_functions =\ndisable_classes =" >> drush.ini;echo "export PATH=\"~/bin/drush\:$PATH"" >> ~/.bash_profile;source ~/.bash_profile


Updated 2/14/2013: Dreamhost made some config changes that required a different PATH variable for this method to work. The instructions above have been updated to reflect this. Editing drush.ini is now suggested to be done with nano, since some folks were having issues with the quad-chevron approach.

[box type=”note”]

Robin Monks has a passion for openness and freedom in technology and he’s spent the last 8 years of his life developing, supporting and maintaining open source software. He’s part of the panel of Drupal community experts who authored The Definitive Guide to Drupal 7 and currently provides independent consulting services. Reach him at 1-855-PODHURL.[/box]

Show CommentsClose Comments


  • Frost
    Posted December 23, 2012 at 3:16 pm 0Likes

    Once inside the .drush directory we need to override some configuration values. However, this command:

    cat <>drush.ini

    returns the following error:

    -bash: syntax error near unexpected token ‛>>’

    Can you please clarify what should be happening in this step?

    • Robin Monks
      Posted February 14, 2013 at 9:51 pm 0Likes

      Sorry for the very delayed reply, Frost. I’ve updated the instructions to work with the latest MediaTemple updates. Please try again and let me know if you have any more problems.


  • Roel
    Posted May 15, 2013 at 8:29 pm 0Likes

    I follow the tutorial but when running drush status I’m getting “command not found”. Are you sure these steps are still relevant today ?

    • Robin Monks
      Posted May 15, 2013 at 10:48 pm 0Likes

      Steps should still be relevant (although I no longer have a gs to test on). Specifically, make sure your bash profile is being updated and reloaded (you make need to log out and back in).

Leave a Reply

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

Our time: 1:40am PDT