If you’re a Drupal developer, you know it’s a headache to set up local Drupal development sites. As you know, Drupal hosting comes in a variety of flavors, and it’s cumbersome to match each local development site with the production site. That’s why we, as an agency, prefer Pantheon for all customer production sites.
Pantheon helps streamline our website development efforts with unrivaled speed, uptime, and scalability, making Pantheon’s high-performance hosting platform the best place to host Drupal sites and applications. Developers often struggle with local development, delaying solutions to client problems with non-billable time. While searching for an answer, we found Lando. Lando has us up and running in moments with its tight integration with Pantheon, enabling our agency to test anything in a local environment that closely matches Pantheon.
Developers often struggle with local development, delaying solutions to client problems with non-billable time. — Erik Cochran, CTO, Molly Duggan
Get Started with Lando
If you are already using Pantheon and assuming you’re already using Terminus, getting started with Lando is easy. Follow these instructions to install Lando today.
- Install with Brew $ brew cask install lando or find a specific version at https://github.com/lando/lando/releases
# Install brew 🍺 brew install --cask lando
- After installation, go to Pantheon > Personal Settings > Tokens and create a new token to use with your new Terminus/Lando intergration. Copy the token script and run it in your terminal: $ terminus auth:login –machine-token=[UniqueToken] and once more with lando in front $ lando terminus auth:login –machine-token=[UniqueToken]
terminus auth:login --machine-token=[UniqueToken] lando terminus auth:login --machine-token=[UniqueToken]
- If you have a site downloaded from Pantheon on your local machine, all you need to do is $ cd [PantheonSiteDirectory] and run $ lando init –recipe pantheon and walk through the prompts.
- If you want to use Lando to grab a Pantheon site and build it on your local, the command is slightly different. In your terminal, run $ lando init pantheon and walk through the prompts.
lando init pantheon
Now you’re ready to develop with Lando. Some commands you’ll need to know are:
cd [PantheonSiteDirectory] # The next command will create a new file on your local (.lando.yml) that you can push to Pantheon for other lando users lando init --recipe pantheon # Start 🏁 your application lando start # Go make a ☕️ cup of coffee while everything spins up
Now that you have your local Lando set up, you’ll need to get your database and files from Pantheon. Run $ lando pull. If you have your codebase already, choose none on the first option for code.
# Get your Database and Files from Pantheon lando pull
# Push a code commit and optionally push the database and files. lando push # Options to pull code from DEV and database and files from any environment including multidevs lando pull # Get URL’s for the local site and publicly accessible domains sharing your builds. lando list # Stop your Local lando lando stop