We should all be familiar with the typical install process of Drupal: download the files, create the database, set up a localhost, open a browser, and finish the installation. As we all know, this is a necessary evil, but also a time-consuming task. Since we now have Drupal Console installed, we can achieve all this by executing one single command.
Begin by opening a Terminal window, changing into the mastering folder, and executing the following command:
./vendor/drupal/console/bin/drupal site:install
This command will begin a series of prompts that will walk us through the remaining install process, beginning with choosing an install profile:
Select the Standard install, which is option 1, and press Enter.
We will then be prompted to select the language that we want Drupal installed in:
Input English and then press Enter.
Next, we will be prompted to choose the Drupal Database type, Database File, and Database Prefix that Drupal will use for the necessary database and tables. For the sake of demonstration, we will let Drupal Console create an SQLite database:
Select option 2 and then press Enter. Next, we will enter a value of mastering.sqlite as the default name for the Database File and leave the default for the Database Prefix.
At this point, we will be prompted to provide the site name for our Drupal instance:
Input the site name as Mastering Drupal 8 and then press Enter.
Drupal Console now requires us to provide a site email that will be used to notify us of any updates, users that request an account, and various other administrative notifications:
Input the email as admin@example.com and then press Enter.
The next three values we will need to provide will be for our administrator's account and consist of the admin account name, e-mail, and password:
We will input admin for our administrator account name and then press Enter.
Next, we will add a generic administrator account email of admin@example.com and then press Enter.
Finally, we will input an administrator account password of admin and then press Enter.
At this point, Drupal Console will begin the install process and configure our new Drupal 8 instance. If everything is successful, we will be prompted with a notification that the Drupal 8 installation was completed successfully:
Now that Drupal 8 is installed and configured, it would be nice to not have to always type the full path to Drupal Console the next time we want to use it. We can shorten this up to just entering drupal by installing Drupal console globally like we did for Drush.