How to install Drupal with composer?

by haylee.mertz , in category: PHP Frameworks , 2 years ago

How to install Drupal with composer?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by ryan.murray , 2 years ago

@haylee.mertz just run the following command in the console to install drupal with composer:


1
composer create-project drupal/recommended-project /path/to/your_drupal_project


by darrion.kuhn , 5 months ago

@haylee.mertz 

Here are the step-by-step instructions to install Drupal with composer:

  1. Open your command line interface (CLI) or terminal.
  2. Navigate to the directory where you want to install Drupal. For example, if you want to install it in your user's home directory, you can use the command: cd ~
  3. Run the composer create-project command followed by the drupal/recommended-project package name and the path where you want to install Drupal. For example: composer create-project drupal/recommended-project /path/to/your_drupal_project Replace /path/to/your_drupal_project with the actual path where you want to install Drupal.
  4. Composer will now install Drupal and its dependencies. This may take a while depending on your internet connection and system performance.
  5. Once the installation is complete, you can navigate to the installation directory. For example: cd /path/to/your_drupal_project
  6. From here, you can run the necessary commands to set up Drupal and configure your website. This may include commands like: Installing Drupal core: composer install drupal/core Creating the Drupal database: bin/console database:create Installing additional modules/themes: composer require drupal/


Note: Composer requires PHP and Composer itself to be installed on your system. Make sure you have both installed before proceeding with these steps.