logo

To install a module in Drupal 10 using Composer

29
January

To install a module in Drupal 10 using Composer
By: Anonymous | Published On: Wed, 01/29/2025 - 15:33

Open a terminal and go to the root directory of your Drupal project.

cd /path/to/your/drupal-project

Use the following Composer command to download the module:

composer require drupal/module_name

Replace module_name with the actual machine name of the module. For example, to install the Pathauto module:

composer require drupal/pathauto

This will download the module and place it inside the web/modules/contrib/ directory.

After installation, clear the cache to ensure Drupal recognizes the new module:

If Drush is installed then you can use the following command to clear cache

drush cache:rebuild

If drush not installed then you can clear the cache from the Drupal Admin UI under:
AdministrationConfigurationPerformanceClear Cache

Enable the module using Drush:

drush en module_name -y

For example

drush en pathauto -y

Alternatively, enable the module from the Drupal Admin UI:
ExtendFind the moduleCheck the boxClick "Install"

 

Need Help ?