Suite of Services

Is it too good to be true? Local Drupal development with Lando and Pantheon

Erik Cochran

Erik Cochran

Updated 7/6/2022

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

For more commands, visit https://docs.lando.dev/cli/. Check out this tutorial from Lando if you need a little more guidance.

				
					# 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
				
			

Lando can speed up your local development efforts and cut the time it takes to deploy changes to your production website. If you’re an enterprise organization struggling with local development, visit mollyduggan.com/webops and learn how we can help you.

If you’re ready to make the next move and upgrade to Drupal 9, you’ll want to see this.

What We're Thinking About