Custom modules and themes may not be available via Composer and their files will need to be manually installed.
Use this approach if you created a custom module/theme or received its files from someone.
When installing or updating the core software, contributed modules, and contributed themes you should use Composer. See Section 3.5, “Using Composer to Download and Update Files”, Section 11.3, “Downloading and Installing a Module from Drupal.org”, and Section 11.5, “Downloading and Installing a Theme from Drupal.org” instead of this topic.
If you are installing a module or theme from Drupal.org, follow the downloading instructions, and then the uploading/unpacking instructions. If you created the module or theme, skip the downloading step. Instead, create an archive file (that you know how to extract on the server) and proceed with the steps in uploading/unpacking, using whatever method is appropriate for the way you initially created the archive file.
-
If you are adding a new module or theme, create subdirectories in your top-level modules and themes directories (if they don’t already exist). Typically, people make a contrib subdirectory for contributed modules and themes that are downloaded from Drupal.org, and a custom subdirectory for modules and themes that they created. Your modules directory might look like this:
Image - If you are replacing an existing module or theme with an updated version, put the site into maintenance mode. See Section 11.2, “Enabling and Disabling Maintenance Mode”.
- If you are replacing an existing module or theme with an updated version, find and delete all the existing files and directories for the existing module or theme. Modules are normally located in directories under the top-level modules directory, and themes are normally located in directories under the top-level themes directory.
- Upload the .tar.gz file (or whatever archive you created) to your site. Place it in either the same location from which you deleted the directory (if replacing an existing module or theme) or the appropriate subdirectory of modules or themes (if adding a new module or theme).
-
Extract the files from the .tar.gz archive (or whatever archive you created), making a subdirectory in the same location as the archive file. If you do not have terminal access, or your hosting server is not running Linux, your hosting control panel’s file manager should provide a way to extract the files. If you have terminal access to your hosting server (running Linux) and you are using a tar.gz file, you can use a command like:
tar -xzf custom_toolbar-2.4.0.tar.gz
- Delete the compressed file from the server, unless your unpacking method already deleted it.
- Refer to Section 11.3, “Downloading and Installing a Module from Drupal.org”, Section 11.5, “Downloading and Installing a Theme from Drupal.org”, Section 13.6, “Updating a Module”, or Section 13.7, “Updating a Theme” to complete the installation or update of the module or theme. Start at the step after the automatic download has been completed.
- If you work with multiple environments (for example, a local development site and a production site) you will have to repeat the steps on each environment, or re-clone the environment. See Section 11.8, “Making a Development Site”.
- If you added a new theme, navigate in the Manage administrative menu to Appearance (admin/appearance) and uninstall the old theme.
Attributions
Written and edited by Boris Doesborg, Jennifer Hodgdon, and Marc Isaacson, and Joe Shindelar at Drupalize.Me.