On this page
- Prerequisites
- Summary of Installing Modules
- Step 1: Add the module
- If Drupal core module, go to step 2
- Several ways to add modules
- Add a module with Composer
- Add a module with Ludwig
- Step 2: Install the module
- Using the Drupal User Interface (easy)
- Or use Drush command line tool (advanced, but very efficient)
- Step 3: Set user permissions
- Step 4: Configure a module
- Additional information
- Keeping modules organized
- Multiple modules packaged in one project
Installing Modules
Install one or more modules in order to alter, extend, or enhance Drupal 10 with additional features.
Prerequisites
- What is a module?
- Learn about finding and evaluating modules.
- More information about evaluating modules.
Summary of Installing Modules
You start by adding a module, then install it (/admin/modules) to make it work, then set Permissions (/admin/people/permissions) to allow people to use it, and Configure it (location varies by module as described on its page). These steps are separated for security.
As time passes, you Update modules (/admin/modules/update) regularly for security and functions. If you don't need a module, you can't just disable it as in Drupal 7, but you need to Uninstall it (/admin/modules/uninstall) (or this). Note: This will also remove the configuration. Finally you can remove the module folder, which is not required, but keeps your site clean.
Step 1: Add the module
If Drupal core module, go to step 2
If the module you want to install is part of Drupal core you can skip ahead to the next step. To find out if it's in core, go to site's /admin/modules page. Core modules are already included so don't need to be added.
Several ways to add modules
The recommended way of adding a module is with Composer, especially for modules that have dependencies. Several modules will just not work if you only add the zip / tar.gz file.
Though not recommended, if you can't use Composer on your site (such as shared host), you can simulate Composer using Ludwig for those (few) modules that offer Ludwig.
Also not recommended, but you can add by manually downloading the .zip or .tar.gz file. This only works for modules that don't have dependencies.
Add a module with Composer
To download a contributed module along with its dependencies, go to the project page (for example https://www.drupal.org/project/admin_toolbar) and copy the Composer command under "Releases":
composer require drupal/admin_toolbar
Run the command from your command line. Once the command is complete you should see a message indicating the module has been added to your project's composer.json file as a dependency and the related code has been downloaded.
For more information, and a video demonstration, see: Using Composer to Download and Update Files, and Downloading contributed modules and themes using Composer
Add a module with Ludwig
For those who can't yet use Composer on your site (such as shared host), you can simulate Composer using Ludwig for those (few) modules that offer Ludwig. This is not a recommended way and it's not available for all modules, but for some modules and for some situations like shared hosts or local windows, it's handy. Here's an example.
Step 2: Install the module
Using the Drupal User Interface (easy)
- Navigate to the Extend page (admin/modules) via the Manage administrative menu
- Locate the module(s) you wish to install and check the box next to each one
- Click Install to install (turn on) the new module(s)
Or use Drush command line tool (advanced, but very efficient)
- Install Drush ("Drupal Shell") command line tool
- Run this Drush command, with the project name(s) as a parameter
drush install admin_toolbar admin_toolbar_tools admin_toolbar_search
Step 3: Set user permissions
So many people forget to set permissions (/admin/people/permissions) for the newly added module. Without giving the right permissions, your users will not be able to use the module. For security, permissions are not initially installed, after adding a new module, for anyone except the Administrator.
See Permissions and configuration for the Workbench Menu Access module for an example, and The permission layers explained from the Group module documentation for more information.
Step 4: Configure a module
A few modules work without any need for setting permissions or configuring. Most, however, require one or both. You'll find configuration instruction on each module's page, in its documentation, or README.md file.
Additional information
Keeping modules organized
Drupal will look for modules in a few different locations; The root /modules directory (preferred), or any /sites/*/modules directory. Within these locations, Drupal will recurse through all subdirectories looking for modules.
A common practice is to add all modules downloaded from Drupal.org to /modules/contrib. And all modules containing custom project-specific code to /modules/custom.
Multiple modules packaged in one project
It is not uncommon for a single project (e.g. https://drupal.org/project/devel) to contain multiple modules. Each module within the project will be represented and can be individually installed, on the Extend page.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion