Acquia Copilot is a conversational AI connected into our product documentation and knowledge base. Ask Copilot about product features, technical details, troubleshooting and how to get started with Acquia products.
Open a command prompt window to access your website’s code.
Using the cd command, navigate to the directory containing your website’s composer.json file, which is typically the directory above your website’s docroot directory.
Run the following command:
composer require drupal/[module_name]
where [module_name] is the project name from Drupal.org. The preceding command will download the module to the appropriate place in your code repository, and add the following instructions to the require statement in your composer.json file, again replacing [module_name] with the project name from Drupal.org:
"require": {
"drupal/[module_name]": "1.x-dev"
},
Commit the changes to your branch and push the changes to your code repository. For information about deploying your code on Cloud Platform, see Code workflows with Cloud Platform.
After you have added a module, you should enable the module.
For procedures you can use to set up and use Composer locally with your Cloud Platform-hosted websites, see Using Composer with Drupal sites. The Drupal community also offers support for using Composer to install Drupal packages on Drupal.org.
Adding a module using Drush
In some cases, you can also install and enable modules using a Drush command, though Composer is the preferred method for the current Drupal version. To install and enable a module using Drush:
Open a command prompt window to access your website’s code.
Using the cd command, navigate to your website’s docroot directory.
To download the module, run the following command:
drush dl [module_name]
where [module_name] is the project name from Drupal.org. For example, the project name for the Acquia Connector module is acquia_connector, from https://www.drupal.org/project/acquia_connector
Note
You can append -y to the preceding command to accept the confirmation questions Drush displays.
Commit the change to your branch and push the change to your code repository.
After you have added a module, you should enable the module.
Open a command prompt window to access your website’s code.
Using the cd command, navigate to your website’s docroot directory.
To download the module, run the following command:
drush en [module_name]
where [module_name] is the project name from Drupal.org.
Note
You can append -y to the preceding command to accept the confirmation questions Drush displays.
After enabling your desired module, you should review next steps to complete the module’s configuration.
Enabling a module using the Drupal user interface
To enable a module from the Drupal user interface:
Sign in to your website as an administrator.
Go to the Modules page by using one of the following methods:
In the administrative menu, click Extend.
In your browser’s address bar, go to http://[your_site]/admin/modules (where [your_site] is your website’s URL).
In the module list, find the module you want to enable, and then select its checkbox.
Scroll to the bottom of the webpage, and then click Install.
After enabling your desired module, you should review next steps to complete the module’s configuration.
Finding next steps
After you have added and enabled a module locally, you must configure the module’s settings or make changes to website user permissions. For more information, ensure you review the documentation provided either with your module or on your module’s Drupal.org project page.
Open a command prompt window to access your website’s code.
Using the cd command, navigate to the directory containing your website’s composer.json file, which is typically the directory above your website’s docroot directory.
Run the following command:
composer require drupal/[module_name]
where [module_name] is the project name from Drupal.org. The preceding command will download the module to the appropriate place in your code repository, and add the following instructions to the require statement in your composer.json file, again replacing [module_name] with the project name from Drupal.org:
"require": {
"drupal/[module_name]": "1.x-dev"
},
Commit the changes to your branch and push the changes to your code repository. For information about deploying your code on Cloud Platform, see Code workflows with Cloud Platform.
After you have added a module, you should enable the module.
For procedures you can use to set up and use Composer locally with your Cloud Platform-hosted websites, see Using Composer with Drupal sites. The Drupal community also offers support for using Composer to install Drupal packages on Drupal.org.
Adding a module using Drush
In some cases, you can also install and enable modules using a Drush command, though Composer is the preferred method for the current Drupal version. To install and enable a module using Drush:
Open a command prompt window to access your website’s code.
Using the cd command, navigate to your website’s docroot directory.
To download the module, run the following command:
drush dl [module_name]
where [module_name] is the project name from Drupal.org. For example, the project name for the Acquia Connector module is acquia_connector, from https://www.drupal.org/project/acquia_connector
Note
You can append -y to the preceding command to accept the confirmation questions Drush displays.
Commit the change to your branch and push the change to your code repository.
After you have added a module, you should enable the module.
Open a command prompt window to access your website’s code.
Using the cd command, navigate to your website’s docroot directory.
To download the module, run the following command:
drush en [module_name]
where [module_name] is the project name from Drupal.org.
Note
You can append -y to the preceding command to accept the confirmation questions Drush displays.
After enabling your desired module, you should review next steps to complete the module’s configuration.
Enabling a module using the Drupal user interface
To enable a module from the Drupal user interface:
Sign in to your website as an administrator.
Go to the Modules page by using one of the following methods:
In the administrative menu, click Extend.
In your browser’s address bar, go to http://[your_site]/admin/modules (where [your_site] is your website’s URL).
In the module list, find the module you want to enable, and then select its checkbox.
Scroll to the bottom of the webpage, and then click Install.
After enabling your desired module, you should review next steps to complete the module’s configuration.
Finding next steps
After you have added and enabled a module locally, you must configure the module’s settings or make changes to website user permissions. For more information, ensure you review the documentation provided either with your module or on your module’s Drupal.org project page.