composer create-project drupal/recommended-project:^9.0 my-site-name Use code with caution.
Version 7.3 or higher is required for Drupal 9, though later versions like PHP 8.x are recommended for better performance and security. Database: MySQL 5.7.8+, MariaDB 10.3.7+, or PostgreSQL 10+. Step 1: Download Drupal 9 Core
Once your core is set up, never download modules manually. Use the composer require command to automatically fetch the module and any secondary libraries it needs. composer require drupal/admin_toolbar Use code with caution. Download a Theme: composer require drupal/bootstrap Use code with caution. Step 3: Update Drupal Core and Dependencies composer download drupal 9
The recommended way to start a new project is using the drupal/recommended-project template. This setup places your web files in a /web directory for better security.
Using Composer to download and manage Drupal 9 is the industry-standard method for building modern, scalable websites. Unlike the legacy manual "zip and upload" method, Composer handles complex dependencies, ensures core security updates are seamless, and manages contributed modules with a single command. composer create-project drupal/recommended-project:^9
Before you begin, ensure your server meets the following requirements: Installed globally on your machine.
One of the biggest advantages of using Composer is the ease of updates. You can update your entire site to the latest minor version (e.g., from 9.4.0 to 9.5.0) with one command: Step 1: Download Drupal 9 Core Once your
Run this command in your terminal, replacing my-site-name with your desired folder:
After running this, always execute drush updatedb or visit your site's update script ( /update.php ) to finalize database changes. Using Composer to Install Drupal and Manage Dependencies
composer update drupal/core-recommended --with-all-dependencies Use code with caution.