DEV Community

Eelco Verbrugge
Eelco Verbrugge

Posted on

Install Drupal 10 with Lando

In this post, we will guide you through the process of setting up a Drupal 10 project using Lando, a powerful local development environment.

Before we begin, make sure you have PHP, Composer, Docker and Lando installed on your system. We'll then download Drupal 10 and configure a basic Lando setup.

Step 1: Install PHP

Ensure PHP is installed on your machine. You can follow the official PHP installation guide for your operating system.

php.net

Step 2: Install Composer (Make it Global)

Install Composer and make it globally accessible. You can download it from getcomposer.org and follow the installation instructions.

Step 3: Install Docker

Download and install Docker from the official Docker website.

docs.docker.com

Step 4: Install Lando

Install Lando by following the instructions on the official Lando website or by using a package manager like Homebrew.

docs.lando.dev

Step 5: Download Drupal 10

Download Drupal 10 to your desired location. You can use git or download the tarball from Drupal's official website.

drupal.org

Step 6: Initialize Lando

Navigate to your Drupal 10 project directory and run the following commands:

$ lando init
Enter fullscreen mode Exit fullscreen mode

Follow the prompts:

  • Choose current working directory as the app's codebase.
  • Select 'drupal10' as the recipe.
  • Set the webroot relative to the init destination as './web'.
  • Name your app, e.g., 'my-first-drupal-10-project'.

Step 7: Start Lando

Start your Lando environment:

$ lando start
Enter fullscreen mode Exit fullscreen mode

Step 8: Check Database Information

To access your database, use the following command:

$ lando info
Enter fullscreen mode Exit fullscreen mode

Take note of the database name, password, user, and optionally, the hostname.

Go to your browser and follow the Drupal installation.

Bonus

Step 9: Stop Lando

Stop your Lando environment when needed:

$ lando stop
Enter fullscreen mode Exit fullscreen mode

Step 10: Modify PHP Version

Edit your .lando.yml file to set the PHP version to 7.4 under the config section.

Step 11: Restart Lando with PHP 7.4

Restart Lando to apply the changes:

$ lando start
Enter fullscreen mode Exit fullscreen mode

Step 12: Verify PHP Version

Access your Lando environment and check the PHP version:

$ lando ssh
$ php --version
Enter fullscreen mode Exit fullscreen mode

Step 13: Rebuild Lando

If needed, rebuild your Lando environment:

$ lando rebuild
Enter fullscreen mode Exit fullscreen mode

Step 14: Verify PHP Version Again

After rebuilding, check the PHP version once more:

$ lando ssh
$ php --version
Enter fullscreen mode Exit fullscreen mode

Summary:

Congratulations! You've successfully set up a Drupal 10 project using Lando, managing PHP versions seamlessly. Remember, these steps provide a foundation for your local development environment, allowing you to efficiently work on your Drupal projects.

Top comments (0)