Local Drupal Setup Simplified with Lando

Drupal learning curve is considered to be steep and one thing contributes to this is the difficulties exprienced by a newbie to setup a local dev enviornment for drupal, as it involves installation of multiple packages to the machine like php, mysql, composer, drush etc., but gone are the days when setting up dev enviornments use to be such a tedious and time consuming task. Here in this post we are going to learn about Lando a docker based open source local development and devops tool used by begineers to professionals.

What is Lando ?

Lando is a docker based containerised development environment tool which automates the containerisation of drupal or many other php applications, long story short you can consider it as an alternative to XAMP, WAMP servers but here you do not need to install any other thrid party php packages as lando comes with all dependencies preinstalled as needed by the application.

Ahh, Why so much theory I know its boring so lets start some hands on and setup Drupal 8/9/10 using Lando. Below are the details steps from installing lando to having a running instance of drupal 8 in your browser.

 Step-1 : Installation of Lando and its dependencies.

Dependencies: As mentioned earlier lando is an abstraction over docker, hence it dependent on docker so you need to make sure docker is installed on you machine before lando is installed.

Step 1.1 Docker Installation Steps

A) Docker Desktop installation on Mac OS:
Mac with intel chip: 
1. Download docker.dmg file. Click here to download.
2. sudo
hdiutil attach Docker.dmg

3. sudo /Volumes/Docker/Docker.app/Contents/MacOS/install
4. sudo hdiutil detach /Volumes/Docker
Mac with apple chip: 
1. Download docker.dmg file. Click here to download.
2. sudo
hdiutil attach Docker.dmg

3. sudo /Volumes/Docker/Docker.app/Contents/MacOS/install
4. sudo hdiutil detach /Volumes/Docker

B) Docker installation on Linux

The detailed instruction to install docker for linux can be found here. 

Step 1.2 Lando Installation Steps:

Once Docker is installed now we will have to install Lando as below:

A) Lando installation on Mac OS:
There is an option of installating laando via homebrew but as it is not maintained by the lando team I would indeed suggest you to download the LandoInstaller.dmg file form the lando github repo

1. Download the lando installation file lando-x64-v*.*.*.dmg file from here.
2. Mount the dmg by double clicking on the downloaded .dmg file.
3. Double click on the LandoInstaller.pkg
4. Follow the installation flow as guided in the setup flow.

There you go, once the above installation is done, just open your terminal and run

lando version 

If you see the output as the version number as below, then this confirms that your lando is setup successfull

Output: v3.6.5