Drupal has evolved it's structure during the recent years, previous Drupal installations were manual processes, Aren't Drupal 8/9 installation seems tedious! it's absolutely easy let's do it together.
Before Looking further, you'll have the prerequisite knowledge of composer. In short here the role of composer is to manage Drupal and all related dependencies (modules, themes, libraries). Make sure you have composer installed on your local machine before executing any Composer commands.
Creating a Project:
Let's create an Drupal 8 / 9 project with composer by using the following commands:
composer create-project drupal/recommended-project Your_Directory_Name
Once you have successfully run the command it will create a Directory for your project and will execute "Composer install" to install the latest and stable version of Drupal.
Let's create a project "design-shop" via composer
composer create-project drupal/recommended-project design-shop
Create a Database and give it's details inside your Drupal Project
sites/default/settings.php Happy Installation!
To create a database via terminal, let's log in to mysql via terminal
mysql -u [USERNAME] -p
Then run the following command to create a database.
CREATE DATABASE [DATABASE_NAME];