Installing Modules

Last updated on
5 August 2023

Install one or more modules in order to alter, extend, or enhance Drupal 10 with additional features.

Prerequisites

Summary of Installing Modules

You start by Adding a module then immediately 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.

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.

In addition, 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 install a contributed module along with its dependencies, go to the project page (for example https://www.drupal.org/project/geofield) and copy the Composer command under "Releases":

composer require drupal/geofield

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 using Drupal's User Interface

An alternative way of installing a module is to click on the latest release on the module's page, for example https://www.drupal.org/project/file_replace/releases/8.x-1.3. Then copy the "tar.gz" link under the "Alternative installation files", and paste that link on your site at /admin/modules/install in the URL box and press Install. Now skip to the next step.

For more detailed instruction, see Downloading and Installing a Module from Drupal.org.

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):

  1. Navigate to the Extend page (admin/modules) via the Manage administrative menu
  2. Locate the module(s) you wish to install and check the box next to each one
  3. Click Install to install (turn on) the new module(s)

Or use the command line (advanced, but very efficient).

For more details, and a video demonstration, see: Downloading and Installing a Module from Drupal.org, and Installing Modules from the Command-Line.

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

Page status: No known problems

You can: