This tutorial explains how to install an existing Drupal 9 website locally with Lando.

Step 1: clone your repository

So I first cloned my repository

git clone <my-repository>

Step 2: run composer install

composer install

This will install all the vendor packages etc

Step 3: initialize and start Lando

lando init --source cwd --recipe drupal9 --webroot web --name stefvanlooveren
lando start

 Step 4: site installation

lando drush si --db-url=mysql://drupal9:drupal9@database/drupal9 --account-pass=content -y

If drush was not working at this stage, do the command below and after this the command above again:

lando rebuild

Output should now look as this:

 [notice] Starting Drupal installation. This takes a while.
 [notice] Performed install task: install_select_language
 [notice] Performed install task: install_select_profile
 [notice] Performed install task: install_load_profile
 [notice] Performed install task: install_verify_requirements
 [notice] Performed install task: install_settings_form
 [notice] Performed install task: install_verify_database_ready
 [notice] Performed install task: install_base_system
 [notice] Performed install task: install_bootstrap_full
 [notice] Performed install task: install_profile_modules
 [notice] Performed install task: install_profile_themes
 [notice] Performed install task: install_install_profile
 [notice] Performed install task: install_configure_form
 [notice] Cron run completed.
 [notice] Performed install task: install_finished
 [success] Installation complete.

I have a default installation available at myproject.lndo.site !

Step 5: import your mysql

lando db-import backup.mysql

Voila, visit your site and you are ready.

 

 

Saved you some valuable time?

Received 100 so far from 4 kind contributors.