Setup
Download the latest version of Drupal using Composer. With Composer is easy to manage all the Drupal dependencies.
composer create-project drupal/recommended-project my_project
This command automatically executes the composer install command and download the latest Drupal version.
Infrastructure
Drupal requires a web and database server. Usually Drupal is installed in LAMP (Linux, Apache, MySQL and PHP) stacks, but if you want to test Drupal locally you can use a Lando recipe. Lando is an open source development environment built on top of Docker.
The command lando init will initialize the project and use it with a Lando recipe. Follow this tutorial for the options https://docs.lando.dev/config/drupal9.html#getting-started.
lando init
After you choose the options to create the project, you will need to start the app. On first run this will build all relevant containers needed to run the app. On subsequent runs it will simply start the built containers.
lando start
Once your has started, the terminal will display the application urls
Here are some vitals:
NAME myProject
LOCATION /path/to/the/project/MyProject
SERVICES appserver, database
APPSERVER URLS https://localhost:54438
http://localhost:54439
http://my-project.lndo.site:8000/
https://my-project.lndo.site:444/
Installation
Now you have the setup ready, go to https://my-project.lndo.site:444/ and start the installation.
The first step is to choose the language for the website, the click Save and continue button.
Then you have to select between the different installation profiles. The Standard will install the commonly used features pre-configured.
The next step is the database configuration. You need to fill the settings to connect the installation with the database. When you type lando info, it will display the installation information that we can use to connect to the database.
internal_connection: { host: 'database', port: '3306' },
creds: { database: 'drupal9', password: 'drupal9', user: 'drupal9' },
The Drupal installation process will start when you click the Save and continue button
In order to finalize the installation, you will have to complete the Website information details.
The installation will finalize after you click Save and continue button. Congratulations, you have successfully installed Drupal 9!