Skip to content

Lando

lando start and Lando URLs on Local Development Environment

After lando start command Lando will give you the urls

burak@kbo-thinkpad-x1-carbon:~/works/lando/your-repo-root$ lando start
Starting landoproxyhyperion5000gandalfedition_proxy_1 ... done
Starting devsite_pma_1       ... done
Starting devsite_mailhog_1   ... done
Starting devsite_database_1  ... done
Starting devsite_appserver_1 ... done
Waiting until pma service is ready...
Waiting until mailhog service is ready...
Waiting until database service is ready...
Waiting until appserver service is ready...
Waiting until database service is ready...

BOOMSHAKALAKA!!!

Your app has started up correctly.
Here are some vitals:

 NAME            devsite
 LOCATION        /home/burak/works/lando/dev-wald
 SERVICES        appserver, database, mailhog, pma
 APPSERVER URLS  https://localhost:32804
                 http://localhost:32805
                 http://devsite.lndo.site
                 https://devsite.lndo.site
 MAILHOG URLS    http://localhost:32801
 PMA URLS        http://localhost:32796

burak@kbo-thinkpad-x1-carbon:~/works/lando/dev-wald$

Besides site URLs, you have also Mailhog and PhpMyAdmin services. However, please take into consideration that the ports will always change after each lando start.

If you lost lando URLs, please run lando info in repo root and find the URLs in your terminal.

lando info result sample is below only showing the site URLS. The list is long and you may find the MailHog and PhpMyAdmin services' URLS in the following lines in your terminal.

burak@kbo-thinkpad-x1-carbon:~/works/lando/dev-wald$ lando info
{
  "appserver": {
    "type": "php",
    "version": "7.2",
    "hostnames": [
      "appserver",
      "appserver.devsite.internal"
    ],
    "via": "apache",
    "webroot": "drupal/web",
    "config": {
      "conf": "/home/burak/.lando/services/config/drupal8/php.ini"
    },
    "urls": [
      "https://localhost:32804",
      "http://localhost:32805",
      "http://devsite.lndo.site",
      "https://devsite.lndo.site"
    ]
  },
...
...
...

Stopping Lando

# change directory to repo root
cd $HOME/works/lando/your-repo-root
lando stop

# Important! This code also shuts down all other Lando instances
# If there are others running.
lando poweroff

Upgrading from previous versions of Lando

# Upgrade from versions pre rc2 to rc23
sudo apt remove --purge lando -y
cd $HOME
# Remove existing lando global config folder
rm -rf ./.lando
# Alternatively, backup lando global config folder instead of removing it.
# mv .lando back.lando
cd Downloads
wget https://github.com/lando/lando/releases/download/v3.0.0-rc.23/lando-v3.0.0-rc.23.deb
sudo dpkg -i lando-v3.0.0-rc.23.deb
lando version #v3.0.0-rc.23

Lando Configurations

Standard

lando init komutu ile recipe seçilerek varsayılan olarak oluşan versiyon. Dosya adı .lando.yml'dir.

name: my-lando-app
recipe: drupal9
config:
  webroot: .

post-start script

lando start komutu ile lando her başlatıldığında çalışır.

name: my-lando-app
recipe: drupal9
config:
  webroot: .
events:
  post-start:
    - appserver: composer self-update

Quick Install Drupal 8 using Lando

This is composer based dependency management. (Not drush or manual etc.)

mkdir -p $HOME/works/lando/test-drupal
cd $HOME/works/lando/test-drupal
lando init

Last commit will ask you questions. See image below to answer them.

picture 1

lando start
# Wait for Lando to finish building and get ready.

# For Drupal 9
lando composer create-project drupal/recommended-project drupal

# For Drupal 8
# 8.9.11 is the latest as of this documentation is written.
# So look at the release page for the latest 8 version.
# https://www.drupal.org/project/drupal/releases/
lando composer create-project drupal/recommended-project:8.9.11 drupal

picture 2

Edit Lando configuration file (.lando.yml) and add the following lines to the end of the file

tooling:
  drush:
    service: appserver
    cmd:
      - "drush --root=/app/drupal"
  composer:
    service: appserver
    cmd:
      - "php -d memory_limit=-1 /usr/local/bin/composer --working-dir=/app/drupal"

So that the final file looks like the below

name: test-drupal
recipe: drupal8
config:
  webroot: drupal/web
tooling:
  drush:
    service: appserver
    cmd:
      - "drush --root=/app/drupal"
  composer:
    service: appserver
    cmd:
      - "php -d memory_limit=-1 /usr/local/bin/composer --working-dir=/app/drupal"

Rebuild Lando

lando rebuild -y

picture 4

Install Drupal

lando drush --root="/app/drupal/web" \
  site-install standard \
  --locale=en \
  --db-url=mysql://drupal8:drupal8@database:3306/drupal8 \
  --site-name=Drupal_8_via_Composer_With_Lando \
  --account-name=admin \
  --account-pass=admin --yes

# Install drush
lando composer require "drush/drush"

Install some essential modules and enable them

Optional reference for module installation

# Require and download modules via composer
lando composer require \
  "drupal/module_filter:^3.1" \
  "drupal/admin_toolbar:^2.4" \
  "drupal/devel:^4.0" \
  "drupal/toolbar_anti_flicker:^3.2" \
  "drupal/transliterate_filenames:^1.5"

# Enable modules via drush
lando drush en -y \
  module_filter \
  admin_toolbar admin_toolbar_tools admin_toolbar_search \
  toolbar_anti_flicker \
  devel devel_generate \
  transliterate_filenames

# Clear cache
lando drush cr