Skip to content
Picture of Geoff St. Pierre
Geoff St. Pierre

Drupal 7 Landoize an Extant App

If you and your team have an existing Drupal 7 application that you would like to use Lando for local development you just need to add a .lando.yml configuration file to the project and commit it to git.

First in a terminal move to the directory that contains your Drupal 7 project:

bash
cd PATH/TO/YOUR/DRUPAL7/APP

Lando Init

Then use the lando init command to build your .lando.yml file:

bash
lando init

Lando will ask you From where should we get your app's codebase? select current working directory.

Then Lando will ask you What recipe do you want to use? select drupal7.

Then Lando needs to know what directory has the Drupal code it asks Where is your webroot relative to the init destination? If your code is in the current directory you can just hit enter.

Nested Web Root

If you are using a nested web root then you should specify the path to the Drupal code here like: web

Then Lando prompts for the app name: What do you want to call this app? you can type anything you like, i.e. MyApp.

The lando init command will create the .lando.yml config file for you. If you chose the drupal7 recipe your config file should look like this:

yaml
name: myapp
recipe: drupal7
config:
  webroot: .

Lando Start

Now you are ready to start your app.

bash
lando start

This will build out the containers necessary for your Drupal 7 app. You'll end up with a screen like this once the app is started:

Now you can copy any one of the resulting URLs and paste it into a browser to visit your Drupal 7 app running in Lando!

Pro Tips

If you issue additional terminal commands or clear the screen you can get the URLs and other info about your app anytime by using the lando info command:

bash
lando info

The info command will give you lots of useful information about your app: