Skip to content

Getting Started with a Drupal 11 Project Using Lando

Published: at 10:20 PM

This guide will walk you through the process of setting up a new Drupal 11 project using Lando.

Prerequisites

Before you start, make sure you have:

Creating a New Drupal 11 Project

  1. Create a new project directory:
mkdir my-first-drupal11-app && cd my-first-drupal11-app
  1. Initialize a Lando project:
lando init \
    --source cwd \
    --recipe drupal11 \
    --webroot web \
    --name my-first-drupal11-app
  1. Create a Drupal 11 project using Composer:
lando composer create-project drupal/recommended-project:11.0.x-dev@dev tmp && cp -r tmp/. . && rm -rf tmp

Note: If you encounter a Composer timeout, run the following command before retrying the previous command:

lando composer config --global process-timeout 2000
  1. Start the Lando environment:
lando start
  1. Install Drush locally:
lando composer require drush/drush

6 Install Drupal:

lando drush site:install --db-url=mysql://drupal11:drupal11@database/drupal11 -y

7 Get information about your project:

lando info

Connecting to your database

Lando will set up a database with a user and password and an environment variable called LANDO_INFO with useful information about accessing other Lando services.

This is the default database connection for a Drupal 11 site. The host is not localhost instead use database.

database: drupal11
username: drupal11
password: drupal11
host: database
# for mysql
port: 3306