A friend of mine got me into Drupal and did the initial setup for me. At first, I was using localhost to play with Drupal and Drush to download and enable modules.

Now I have my own Pantheon hosting site that lets me install Drupal on their side, but how do I link my Drush command prompt to my online site? Before on localhost, it was just a matter of changing directories, but how do I connect it for a site online?

Edit: This is for Drupal 7.


Start off by installing Terminus. Terminus now supports machine tokens; once you set these, up you can authenticate automatically without a password simply by running terminus auth login <email address>.

Once you are authenticated with Terminus, terminus sites aliases will download Drush aliases for all of your Pantheon sites. Since this list can change over time (e.g. when you add or delete sites on Pantheon), you will want to periodically re-run this command. You might even want to have Terminus log in and update your aliases in your shell startup script (e.g. .bashrc).

Once your aliases are up-to-date, you can use a remote site via:

drush @pantheon.mysitename.dev status 
  • You do not need Terminus for any part of this. You can grab the aliases from your Pantheon dashboard and use the Drush command above. I have had issues trying to use Terminus. Possibly due to the old version of Drush being used by Terminus.
    – sareed
    Feb 1 '16 at 14:57
  • True, Terminus is not required; if you only have one Pantheon site, you might be just as happy using the alias download link on the dashboard. If your aliases change frequently, though, then terminus is definitely the way to go. Make sure you are using the new terminus from github.com/pantheon-systems/cli; the older Drush-based Terminus is obsolete, and should not be used. Feb 1 '16 at 16:28
  • @sareed I downloaded the aliases and run above drush command, but I get error "Could not find aliases". Do I need to have the website locally?
    – Umair
    Apr 20 '18 at 7:02
  • @Umair With that error I would imagine your alias file is not in your Drush directory ( .drush in my %HOME% ). However, for Pantheon, my comment has been deprecated. Drush aliases no longer work directly with Pantheon. You will now have to run Terminus to use Drush on Pantheon. I would suggest a Linux box as Windows has a host of issues running it. Or did when I set it up anyway, which was honestly a bit ago.
    – sareed
    Apr 20 '18 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.