Install a WordPress Site with Lando

Team Blog WordPress

WordPress is modernizing, allowing us to rethink how to make the most out of newer tools and technologies. In this guide, Saurabh explains how to install a WordPress site using Lando and composer.
Lando is an Open Source development tool intended for developers who prefer a command-line, painless, easily customizable server environment configuration.

Before You Begin:

  1. Make sure you have Lando installed in your system. If not follow the guide here.
  2. Composer package Manager.

Getting Started:

Getting started with Lando can be disorienting at first. Fear not, mighty developer, that’s why this article exists! I’ll be begun by installing and spinning up a fresh WordPress site locally.

Step 1: Initialize the Lando site:  You can initialize this file running the command on the folder you want to install WordPress site.
lando init

Step 2: Select where you want to install the codebase. I am selecting the “Current working directory”  and press the Enter button.

Step 3: On the above screenshot you will notice this will ask you to select the recipe do you want to use. In our case, I will select the WordPress recipe from the list and press Enter.  And then you will see the next step to choose the folder. As in my current workflow, I would like to use the current destination so I will press enter.

Step 4: Press the enter and it will ask for the name of the app. I am giving the name wp.

The below code is an example of my .lando.yml file which I am using it to set up a new WordPress Site. You can also copy and paste this file in the file .lando.yml within your folder.

Step 5: Start the Lando
lando start
The above command will start the Lando app and gives you some basic information like your App server URLs to access the site in your local browser etc.

Step 6: Once it is successfully started it will give a similar output.

Wooo, now the Lando app has been setup and you can confirm this copying a URL and paste it in your favorite browser. 

Now what next? 

Create a composer.json file to run within the Lando app. This will install the core WordPress. You can follow the below code to use it.

Step 7: Run the command below to install WordPress using the composer within the Lando app.
lando composer install

That’s it. WordPress is installed and you can set up your website.