First you need to install the composer package (preferably globally in the system) following the instructions
Next, preparing database (in my case MySQL)
# mysql -u root -p password
# create database drupal; # use drupal; # grant all privileges on drupal.* to drupaluser@localhost identified by 'password'; # flush privileges; # exit
Next, go to the root folder of your web server (usually /var/www/html), but in our case we will go to the folder a level lower (/var/www), since we will use composer
# cd /var/www
Now typing:
$ composer create-project drupal-composer/drupal-project:8.x-dev html --stability dev --no-interaction
As a result, your Drupal project will be installed in the html folder, for security reasons, the entire web part is moved to the html / web subdirectory. In order for the project to work, you need to slightly change the configuration of your web server (apache / nginh) so that the root of the site points to the folder / var /www/ html/web and at the same time from the folder / var / www / html / you can manage the drupal project from the command line (installing modules, dependencies)
Similar Posts:
- install drupal 8 with composer
- how to install composer latest version
- How to change Drupal core files
- How to install phpMyAdmin with nginx on Debian 11
- composer require fails because it can’t delete default.services.yml