Having Problems with Drupal, Lando, and Pantheon? — Jason Michael Perry

I just spent forever trying to pull a new Drupal 10 website repo from Pantheon and get it running locally with Lando. Brutal. I’m documenting my path in hopes it helps some person some day, which started with this Reddit post: Problem getting Lando set up with Pantheon.

Steps to Get Your Drupal Site Running Locally with Lando and Pantheon:

  1. Clone the Site from Pantheon:
    git clone <pantheon-repo-url>
    This command clones the repository from Pantheon to your local machine.
  2. Initialize Lando:
    lando init
    • Do not select Pantheon as your environment.
    • Select the working path where you pulled the site.
    • For the second option, select Pantheon.
  3. Start Lando:
    lando start
    This command starts the Lando environment for your site.
  4. Pull the Database and Files:
    lando pull
    This command pulls the database and files from Pantheon. (This step WILL fail due to database access issues.)
  5. Destroy the Current Environment:
    lando destroy
    This command destroys the current Lando environment, which can help resolve issues with database access.
  6. Rebuild the Environment:
    lando start
    This command starts the Lando environment again, which should rebuild the database correctly.
  7. Pull the Database and Files Again:
    lando pull
    This command pulls the database and files from Pantheon again, which should now be successful.
  8. Clear All Caches:
    lando drush cr
    This command clears all caches, which can help resolve errors and stability issues. If you haven’t you may need to install Drush first with this command
    lando composer require drush/drush

Now, if you’re lucky, the gods have smiled upon you and you have a running site. Hoping to see this updated in the Pantheon docs or the Lando recipe updated sooner than later.

Uncategorized