How to Install Drupal Module

Installing a 3rd party module and adding more features to a Drupal site is very common, Drupal has made the installation process very easy. But due to lack of the knowledge of Drupal folder structures, some of them might do it in a wrong way and lead to some maintenance in the future upgrading. In below, we will talk about how to install drupal module properly.

Download Drupal Module Source Code

In order to install a module, you will need to download the source code, and unzip it. The best place to find the 3rd party module is in Drupal official site: http://drupal.org/project/Modules, where you can find huge list of free and useful modules to setup a powerful web site.

Upload Drupal Module Source code to Proper Directory

Then, we come to the most important step - unload the code to the correct directory in Drupal server. What the “correct directory” here means?

Drupal can regonize the new module if you upload the source code to one of the below directories:

  • {Drupal}/modules/
  • {Drupal}/sites/all/modules
  • {Drupal}/sites/{site}/modules

And each of above directory has its own purpose.

As a best practice in using open source project, it would be good to keep all the customized code to one place and don’t touch all the core code the open source projects have developed. This will greatly reduce your maintenance cost when upgrading your code to next version. For Drupal, the centralized directory for customized code is {Drupal}/sites.

And about directory {Drupal}/modules/, this is the place to put the Drupal core file, although you can install your module there, we would like recommend you not to do it.

And for {Durpal}/sites/, if you want this module can be used by all the sites you host in your Drupal instance, it would be good to place the module source code to {Drupal}/sites/all/modules. And the module installed in {Drupal}/sites/{site}/modules will be only available in the specific site.

Active Drupal Module

You can go Administrator->Site Building->Modules, check the the module you just install and save the configuratoin to active it.

Now, you should be able to enjoy the module you have just installed.

Tags: Drupal

Leave a Reply