Skip to content

Instantly share code, notes, and snippets.

@dgading
Last active April 27, 2018 16:02
Show Gist options
  • Save dgading/4b70d8373818c1bf2fa5d833f004b88f to your computer and use it in GitHub Desktop.
Save dgading/4b70d8373818c1bf2fa5d833f004b88f to your computer and use it in GitHub Desktop.
Lando Notes

Lando Guide

Lando is built upon Docker, but downloading Lando will also install Docker and Docker Compose locally as well.
Homebrew is the easiest way to keep it updated.

brew cask install lando

After installing, each project will need a .lando.yml file which holds the config for the particular site.

WordPress

To use Lando and WordPress you will need a copy of WordPress, a database, files directory, and a theme. The database will need to be copied into the root directory of the project.

git clone git@github.com:org_name/repo_name.git
cd repo_name
curl -O https://wordpress.org/latest.zip
unzip latest.zip
rm latest.zip
scp sshname@server.com:path/to/db .
lando init --recipe wordpress
lando start

## Install WP through the browser
## DB_HOST=database
## DB_USER, DB_PASSWORD, DB_NAME = wordpress
lando db-import db.sql
lando wp search-replace 'old-domain.com' 'newdomain.lando.site'

Drupal 7

TODO info

git clone git@github.com:org_name/repo_name.git
cd repo_name
scp sshname@server.com:path/to/db .
lando init --recipe drupal7
## If needed, update .lando.yml file with config below
lando start
## If no local settings file, install base site through browser
lando drush sql-drop
lando drush sqlc < db.sql
// Custom Lando config updates, building upon the drupal7 recipe
name: site-name
recipe: drupal7
config:
  //webroot: most D7 sites don't need this, but Acquia sites may have docroot
  php: '5.6' // '7.1' if needed

Drupal 8

TODO info

git clone git@github.com:org_name/repo_name.git
cd repo_name
scp sshname@server.com:path/to/db.sql .
lando init --recipe drupal8
## If needed, update .lando.yml file with config below
lando start
lando composer install
## If no local settings file, install base site through browser
lando drush sql-drop
lando drush sqlc < db.sql
// Custom Lando config updates, building upon the drupal8 recipe
name: site-name
recipe: drupal8
config:
  webroot: web // This will work for most sites, but could be anything
  php: '7.1' // '5.6' if wanting to match clientapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment