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:
- Installed Lando
- Created a Landofile for your code
- Read about Lando’s services, tooling, events and routing
Creating a New Drupal 11 Project
- Create a new project directory:
mkdir my-first-drupal11-app && cd my-first-drupal11-app
- Initialize a Lando project:
lando init \
--source cwd \
--recipe drupal11 \
--webroot web \
--name my-first-drupal11-app
- 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
- Start the Lando environment:
lando start
- 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