Example .lando.yml files for different environments

Category
Drupal Version

Here are some example .lando.yml files (and associated settings.php files for drupal) of commonly-used configurations.

Drupal 7: Single site

Database code in settings.php

$databases = array (
  'default' => 
  array (
    'default' => 
    array (
      'database' => 'myd7sitedb',
      'username' => 'database',
      'password' => 'database',
      'host' => 'database',
      'port' => '3306',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

.lando.yml Code

name: myd7site
recipe: drupal7
config:
  php: '7.3'
  composer_version: 2
  via: 'apache:2.4'
  webroot: .
  database: 'mysql:5.7'
  # note this is just for lando/docker as 'global' install--drush is installed via drupal composer for local site use
  drush: ^8
  xdebug: false
services:
  database:
    creds:
      user: database
      password: database
      database: myd7sitedb
  appserver:
    overrides:
      environment:
        DRUSH_OPTIONS_URI: "https://local.myd7site.gatech.edu"
tooling:
  'lint:php:themes':
    service: appserver
    cmd: /app/vendor/bin/phpcs --standard=phpcs-themes.xml
    description: 'Runs php linter against your custom code. Ex: lando lint:php'
proxy:
  appserver:
    - myd7site.lndo.site
    - local.myd7site.gatech.edu //set in local hosts file

Drupal 7: Multi site

Database code in settings.php

$databases = array (
  'default' =>
    array (
      'default' =>
        array (
          'database' => 'database',
          'username' => 'mysql',
          'password' => 'mysql',
          'host' => 'ic',
          'port' => '3306',
          'driver' => 'mysql',
          'prefix' => '',
        ),
    ),
);

.lando.yml Code

name: multid7
recipe: drupal7
config:
  php: '7.3'
  composer_version: 2
  via: 'apache:2.4'
  webroot: .
  database: 'mysql:5.7'
  # note this is just for lando/docker as 'global' install--drush is installed via drupal composer for local site use
  drush: ^8
  xdebug: false
proxy:
  appserver:
    - cse.lndo.site
    - local.cse.gatech.edu //set in local hosts file
    - ic.lndo.site
    - local.ic.gatech.edu //set in local hosts file
    - scs.lndo.site
    - local.scs.gatech.edu //set in local hosts file
services:
  cse:
    type: mysql:5.7
    appserver:
      overrides:
        environment:
          DRUSH_OPTIONS_URI: "https://local.cse.gatech.edu"
  ic:
    type: mysql:5.7
    appserver:
      overrides:
        environment:
          DRUSH_OPTIONS_URI: "https://local.ic.gatech.edu"
  scs:
    type: mysql:5.7
    appserver:
      overrides:
        environment:
          DRUSH_OPTIONS_URI: "https://local.scs.gatech.edu"

Drupal 9: Single site

Database code in settings.php

$databases['default']['default'] = array (
  'database' => 'myd9db',
  'username' => 'database',
  'password' => 'database',
  'prefix' => '',
  'host' => 'database',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

.lando.yml Code

name: myd9
recipe: drupal9
config:
  php: '7.3'
  composer_version: 2
  via: 'apache:2.4'
  webroot: .
  database: 'mysql:5.7'
  drush: true
  xdebug: false
tooling:
  'lint:php:themes':
    service: appserver
    cmd: /app/vendor/bin/phpcs --standard=phpcs-themes.xml
    description: 'Runs php linter against your custom code. Ex: lando lint:php'
  drush:
    service: appserver
    env:
     DRUSH_OPTIONS_URI: "https://local.myd9.gatech.edu"
proxy:
  appserver:
    - myd9.lndo.site
    - local.myd9.gatech.edu // set in local hosts file
services:
  database:
    creds:
      user: database
      password: database
      database: myd9db

Symfony 4

.lando.yml Code

name: samplesymfony4app
recipe: symfony
config:
  symfony: '4'
  php: '7.3'
  via: 'apache:2.4'
  webroot: public
  database: mysql:5.7
  services:
    database:
        creds:
            user: database
            password: database
            database: gradcc

Symfony 5

.lando.yml Code

name: samplesymfony5app
recipe: symfony
config:
  php: '7.3'
  via: 'apache:2.4'
  webroot: public
  database: mysql:5.7
  services:
    database:
        creds:
            user: database
            password: database
            database: symfony5db

Simple LAMP stack for PHP

.lando.yml Code

name: myphp
recipe: lamp
config:
  php: '7.4'
  via: 'apache:2.4'
  composer_version: '2'
  webroot: public
  database: mysql:5.7
  services:
    database:
        creds:
            user: database
            password: database
            database: myphpdb
  proxy:
    appserver:
      - myphp.lndo.site
      - local.myphp.gatech.edu // set in local hosts file