For a stint in time I was using Lando for local development of our Drupal CMS. The required resources ended up draining more resources than was performant on my MacBook, so I switched development strategies. Your mileage may vary.
Lando lets us easily spin up a local development environment. They have a configuration specifically for syncing with Pantheon.
- Install Docker for Mac from
Docker.dmgfrom the Docker site - Ensure Homebrew is installed and up-to-date
- Install Lando using Homebrew:
brew install cask lando
- Create an empty directory
cdinto the new directory- Run
lando init pantheon. You should be able to select your Pantheon identity and site. - From Pantheon, create a machine token. At the end, run the following to add the token to lando:
lando terminus auth:login --machine-token=<machine-token> - Run
lando start. This spins up the local app server. - Run
lando pull. You will be able to pull code, database and files from a Pantheon environment.
Generally speaking, we use lando pull for the initial build.
For image syncing, rsync them: lando pull --rsync
More examples, from Lando's docs:
# Pull the latest code, database and files
# This will pull the environment associated with your currently checked out git branch
lando pull
# Skip a code merge
lando pull --code=none
# Pull only the database from the test environment
lando pull --database=test --files=none
# Pull only the files
lando pull --database=none
# Pull only the latest files without grabbing a files backup
lando pull --database=none --rsyncWe uselando pushto push up any changes to code, database and files made locally.
Lando only pushes up code by default.
# Push the local code
# This will push to the environment associated with your currently checked out git branch
lando push
# Push only the database and code
lando push --files=none
# Push only the files and code
lando push --database=none # Force shutdown all Docker containers
docker container kill $(docker container ls -a -q)
# Remove all Docker containers
docker container rm $(docker container ls -a -q)
# Remove all Docker images
docker image rm $(docker image ls -a -q)