A compatible version of MySQL, MariaDB, or PostgreSQL must be installed. Step 1: Create the Project
Navigate to your site's URL and follow the setup wizard to provide database credentials and site information. Drush (Command Line): First, add Drush to your project: composer require drush/drush vendor/bin/drush site:install Use code with caution. download drupal with composer
To download and install Drupal with Composer, the industry-standard method is to use the template. This approach automates the download of Drupal core along with its external dependencies, ensuring a secure directory structure where the web-accessible files are isolated in a /web subdirectory. Prerequisites A compatible version of MySQL, MariaDB, or PostgreSQL
Once the files are downloaded, you can complete the installation via your browser or the command line: To download and install Drupal with Composer, the
Navigate to the directory where you want your project to live and run the following command. Replace my_site_name with your preferred folder name:
Because the template uses a relocated web root, you must point your Apache or Nginx configuration to the subdirectory (e.g., /var/www/my_site_name/web ). This prevents public access to sensitive files like composer.json and the vendor/ directory. Step 3: Run the Installation Script
Version 2.7.0 or higher is required for Drupal 11, while Drupal 10 requires at least 2.3.6 .