Drupal is a highly flexible and powerful CMS, suitable for building anything from blogs to enterprise websites. In this guide, we will show you how to install Drupal 10 using Lando and Composer on Ubuntu, making the Drupal setup process smooth and efficient. Lando simplifies local development, and we will explore how to use the correct Lando PHP version and handle Lando install effectively.
Prerequisites
Before we dive into the installation, make sure you have the following prerequisites installed on your Ubuntu system:
- Composer
- Docker
- Lando
Install Docker
Lando operates as a wrapper around Docker, so you need Docker installed first.
To install Docker and Docker compose on Ubuntu refer to official documentation https://docs.docker.com/engine/install/ubuntu/
Verify if docker is installed successfully or not by running the following command:
Refer to the attached screenshot for the output.
Install Lando
Next, we will handle the Lando install. Lando is a powerful tool for managing local development environments, especially for Drupal. Download the latest stable .deb, .pacman or .rpm package from GitHub and install via Ubuntu’s software installer.
Verify if lando is installed successfully or not by running the following command:
Refer to the attached screenshot for the output.
Setup a new Drupal 10 project
You can set up Drupal 10 using Composer to manage dependencies. Start by creating a new Drupal setup project.
Open your terminal and navigate to the directory where you want to install Drupal 10.
Run the following commands:
Refer to the attached screenshot for the output.
Configure Lando
Now that you have your Drupal setup, let's configure Lando to manage it. Create a .lando.yml file in your Drupal project's root directory. Below is a basic configuration:
Start Lando
Once Lando is configured run the following command to start Lando and set up the development environment:
Lando will spin up the necessary services, and you’ll see URLs to access your Drupal 10 site, including the database and other tools.
Refer to the attached screenshot for the output.
To make sure you're using the appropriate Lando PHP version for Drupal 10, run:
Install Drupal
After starting Lando, you can proceed with the Drupal setup by running the installation commands.
To Install via Drupal UI follow below steps -
Access your Drupal installation at https://my-drupal-app.lndo.site in your web browser. Follow the on-screen instructions to complete the Drupal installation.
Ensure you use the database credentials specified in your .lando.yml file. To check the database credentials or other information related to lando run the following command:
Below screenshot shows the lando configurations.
Complete Installation
Once Drupal is installed, the final step is configuring the site according to your needs. You can:
- Set up additional modules and themes.
- Configure the database.
- Ensure the correct permissions and file settings.
Summary
In this guide, we successfully installed Drupal 10 using Lando and Composer on Ubuntu. This approach streamlines the local development process, making it easy to manage complex configurations and run your site efficiently. With Lando, you can also adjust your Lando PHP version and other services dynamically, further enhancing your development workflow.
By following this method, your Drupal setup is now complete and ready for further customization and development!