Last updated August 27, 2015. Created on August 27, 2010.
Edited by latikasDavid_Rothsteinkrina.sonipbulebarLog in to edit this page.

You can add third-party contributed modules to extend or alter Drupal's behavior.

Table of contents:

 

In a nutshell

1. Download the module and extract it in the folder sites/all/modules/contrib. It is recommended to place all third-party modules in a subfolder called contrib.

2. Go to the Module page at Administer > Modules (http://example.com/admin/modules) and enable it.

3. Read the module's documentation (readme file or on-line here on drupal.org) for further configuration instructions.

Note: The drush commands drush dl module_name and drush en module_name offer probably the fastest way installing modules.

 

Choose the module file

Choose the right release. When you have chosen a module to add to your site, you must choose which release to use. The version must be compatible with the version of Drupal you are using. Note that 'Development releases' are versions of the module that are in an active stage of development. They may be written for a previous/current/future version of Drupal, are considered unstable, and should be handled with care. 'Recommended releases' are stable and ready to use.
versions.png

Upload the module

There are two basic ways to upload module files to a Drupal 7 site:

  • Through the Drupal user interface
  • Manually on the server

The first option will not work on many types of servers, but may be a more user-friendly choice on servers where it does work. The second option is always available.

 

Option 1: Upload the module through the Drupal interface

upgrade manager icon for installing new modules

  • Navigate to the install page. Navigate to Modules > List (tab), or http://example.com/admin/modules, and click the link 'Install new module.' (You must have theUpdate manager module enabled to see this link. For those new to Drupal, go to "Modules", find "Update Manager," put a check mark in the box by "Update Manager" and then click "Save" at the bottom of the page. You should now have a link to install new modules.)
  • Follow the prompts. You will be prompted to provide either the URL to the download, or to upload the .tar.gz or .zip file from your local computer. Click 'Install', and the Update manager will copy the files into your sites/all/modules folder. (See Update manager for more information about what that core module can do.) The next screen gives you two links. Click 'Enable newly added modules' and skip down to the 'Enable and configure' section.

    Update manager for installing a module

If your site asks for your FTP username and password, it is referring to the username and password to access your site, not drupal.org

A note about FTP: If FTP is not enabled for your server, you may receive an error message. Drupal will not be able to diagnose the problem, only tell you that there is one. It's up to you to determine whether your server is properly configured for FTP.

 

Option 2: Upload the module manually

  • Extract the files.The downloaded module package will be in a compressed file format such as 'tar.gz'. On Windows, use a program like 7-zip to extract the files. On modern Mac systems, double-click the .tar.gz file. On Linux or similar systems, use the command line:

    tar -zxvf modulename-drupalversionnumber.tar.gz
    You should see a list of files extracted into a folder.

  • Upload the folder. folder placement for contributed modulesTransfer your files with SFTP or FTP to the desired modules folder in your Drupal installation (or if you are using version control, add and commit them to your code repository). The modules folder at the top level of your Drupal installation is reserved for Drupal core modules (the ones that come with the original download of Drupal). Contributed modules belong in sites/all/modules. If you are running a multi-site installation of Drupal, use sites/my.site.folder/modulesfor modules there that are specific to a particular site in your installation. Modules that will be shared between all sites should be placed in sites/all/modules.

Please note: Especially for sites with a lot of additional modules, many people have begun to further divide the modules folder, to help stay organized. A typical way of doing this would be:

  • sites/all/modules/contrib for all contributed modules.
  • sites/all/modules/custom for all custom modules.
  • sites/all/modules/features if you have additional modules that were created usingFeatures.

 

Enable and configure

  • Read the directions. If the module has an installation file (usually INSTALL.txt and/or README.txt), read it for specific instructions. There are modules that require special treatment, and even modules that depend on other downloaded files to function properly. Sometimes the README file has no .txt extension. If you double-click it, your computer won't know what program to use. In that case, open a text editor first, and then open the file using the editor's 'file open' command.
  • Enable the module. Navigate to Administer > Modules or http://example.com/admin/modules. Check the 'Enabled' box next to the module and then click the 'Save Configuration' button at the bottom. Note: If you are updating an existing module, you'll need to click 'update script' at the top of the page or load http://www.example.com/update.php, then click 'Continue' (after making a backup of both your database and 'sites' folder).
  • Set up permissions. Some modules will require that you change permissions to get them working. Permissions information may be in the instructions that came with the module. Navigate to Administer > Modules and click on the 'Permissions' button for the desired module. placement of configure and permissions buttons for modules in Drupal 7You can also do this on the Permissions page (Administer > People > Permissions). Scroll down to see if the module appears in the list and, if it does, give the appropriate permissions to desired roles.
  • Adjust settings. Most modules will have some type of settings page. It will vary from module to module but if not described in the README.txt file, it can usually be located by navigating to (Administer > Modules) and clicking on the 'Configure' link for that module. Not all modules have settings pages.

Please note: You can only have one copy of a module with the same name in each Drupal site. The module's name is determined by the name of the .module file, not by the name of the directory.

Tip: If you run into problems, search the module's issue queue and the forums. If your problem hasn't already been addressed, post a question or issue and someone will try to help you out.

Tip: To keep up-to-date on any issues and fixes related to your newly installed module(s), you can create a user account on Drupal.org (if you haven't done so already) and then subscribe to the feed of each module you are using.

For a collection of useful materials for module developers, see Module Development with Drupal.

AttachmentSize
versions.png173.63 KB
install_new_module_via_drush.jpg248.68 KB

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

No matter which way I go I cannot install a module as a newbie (Drupal 7.0 on Natty) ...

I get the FTP issue when I try to use a URL. This page says "If FTP is not enabled for your server, and you try to install via URL, you may receive an error message", but it's not "my" server, it's yours (ftp.drupal.org)! Surely the wording could be improved here. What exactly needs to be enabled? FTP client access? I'm a Windoz user mainly and don't know Linux that well, but I was a developer so know a bit about these things, and frankly this wording is very confusing.

Trying to use the "Install manually" option, I get the FTP thing again! AAARRRRGGGG! What??? Why is it even talking about FTP when I am selecting a local file. I simply don't understand.

Sorry, but Drupal is really hard to get into, even for a bit of a geek.

I think there is awesome potential here (while not digging the PHP thing), and thanks for all the voluntary effort.

Regards,
Pete Miller (The Captn)

Pete,

It is confusing because there are two FTP connections here - one to ftp.drupal.org to GET the file, and one to your host to PUT the file.
It is the latter that needs to be enabled.

K

I was confused, and I am only semi-new to Drupal. It looked like it was asking for a password to the remote server to download the module. In reality, the remote connection uses http, not ftp, and doesn't require a password. It's asking for credentials to use FTP to write the module to the local machine, probably because the web server doesn't have write privileges to the modules directory (for security reasons), so it needs to use FTP. It's counter-intuitive to think that Drupal needs to FTP in to the local machine. It looks like the directions have been improved on that page in more recent versions of Drupal 7.x, but it could probably stand even a bit more explanation, owing to the counter-intuitive nature of the situation.

I was really having a hard time understanding Drupal until I came across a couple of books (after looking at about 6 others) that got me going. The first was "Foundation Drupal 7" by R. J. Townsend that is really like a "missing" manual for all the Drupal menus and helped me get a handle on the pieces that make up a site, and "Drupal 7 Module Development" by Matt Butcher, et al., which focuses on custom Module development and helped me understand the pieces of a module by showing me how to create my own. I'm not fully there yet, but I think I'm getting how Drupal is put together and how I can make it work for what I need. I was lucky that where I live (Boise, Idaho) my city library has several books on Drupal and especially lucky that I have access to the Boise State University (go Broncos!) library where I got access to the two books I cited above.
On the specific problem you are having installing a module, I wonder if it might be easier (at least for the first module) to install Filezilla on your Windows box for doing the FTP stuff to your site and manually copy the module files over to where they go on your Drupal site? That's kind of what I did (first doing things manually w/Filezilla).
In case it's of any help, I've recently started using a low cost ($5/month, one month minimum) hosting service from DailyRazor (they call it their "Standard Linux Developer PHP/Ruby on Rails" plan). I was previously using WinHost because I was doing .NET stuff but although they supported PHP, they had some trouble with Drupal plugging-and-playing. I found it was very useful to have a remote hosting service (that Drupal runs on) to run my stuff on and the $5 commitment made it pretty easy. I think there are other cheap hosting services (HostGator has been recommended to me) that might be better in long term, so far DailyRazor has worked OK so I'm continuing to use it until I need to change.

I have been on here for 8 hours trying to get at least one thing uploaded to my new site. I put a post up in the forum and have been looking all over the place until I went to the chat and someone posted this page for me. Simple: Enable Modules, then add module, and post the url from the tar.gz and vuala. Down the bottom of the page is the modules that need to be enabled, tick them and save. Have uploaded two modules in five minutes. Thank God for that.

http://lukesarmy.com
Life's misfortune falls disproportionately upon the young.

Just installed Drupal 7 on my localhost and trying to install some modules. The problem is I don't see the "+install new module" word link on my Modules page. And I tried installing manually by placing the folder as instructed, but I still can't find them on the Modules' page to turn them on.

Any help would be appreciated. TIA.

I just did some test and found that the above problem occurred when the site was exported from Drupal Gardens then imported to my local host with Acquia dev desktop. When I created a new site from DAMP, the "Modules install" link was there as expected. Anyone know why that is?

http://www.drupalgardens.com/content/after-exporting-site-where-install-...

Here's the answer.

Lesson learned: when installing modules from sites exported from Drupal Gardens, you have to do it the old-fashion way.

So a site that was exported from Drupal Gardens is fatally flawed to never be able to have the "Install New Module" link on it? Seems there has to be a solution. Anybody?

The "Install new module" link only appears if you have the Update Manager module enabled.

That information should really be added to the documentation above.

The "Install new module" link only appears if you have the Update Manager module enabled.

That information should really be added to the documentation above.

I'm a new user and I had to read the above comment to understand why the link is missing. Please put this information in the docs above.

Thank you.

That answers my question. Thanks.

Thank, dazweeja! That solved my issue.

I got that famous FTP error... always. but I DO have FTP server running and I am sure I am entering the user and password correctly, so I don't realize what's the problem.

Well, I'll try to do it manually, but it is a pain :(

I have been fighting this problem several times, without success.
Now I have been able to pin down the problem.

The wanted behaviour is:

  • You paste the url of the module or theme you want to install
  • You click install
  • Your module or theme gets installed

What I have seen on several installations, and this is what you don't want:

  • You paste the url of the module or theme you want to install
  • You click install
  • It asks for some FTP (or SSH) credentials. WTF??????

To avoid this, make sure the folder /sites/default is OWNED by the user that executes the drupal scripts. On most Ubuntu installations, this is the user apache user: www-data.

Don't ask me why this works. I don't know if this is intended or not. It doesn't make so much sense to me, but there might be an explanation. For me it would be OK that the temporary directory is writable by the apache user and the themes or modules folder is writable as well.

So this should do the trick when the user is www-data:
chown www-data sites/default

I hope this works. Please let me know.

The actual problem is that for some beyond retarded reason in modules/update/update.manager.inc on line 706 (in my present setup, drupal 7.2) the following check is performed:

if (fileowner($project_real_location) == fileowner(conf_path()))

with the comments explaining that conf_path() resolves to e.g.sites/default (why the "e.g." is beyond me - could it be something else?!? or is "i.e." what the authors meant to say?).

The $project_real_location (how real could it be, it is a temporary location underneath temporary:/") is where the file is downloaded and extracted.

Depending on the server setup, this can be randomly complicated by a number of factors. Fact is, even if the web server user has all the rights to write all over the place, it wouldn't make any difference. Enjoy wasting your time trying to make it do so.

And why select a location that is generally created manually prior to installation to check its ownership against files actually created by the web server user. There must be a better way to deal with this.

Eventhough, Wordpress is using a similar mechanism (someone is bound to have borrowed it in/from Drupal), they do have a configuration option that overrides this. This is in particular a problem when users can manipulate their setup, but cannot change ownership of files, and especially critical when performing backup, migration, or other maintenance tasks.

Even if there is no easy workaround for this, there has to be at least a hint clarifying exactly what the problem is and how to go about this in case it occurs.

Also note that the web server user may vary. On our setup it was assigned to games (id=5) for whatever reason, so intuitively changing the ownership to www-data (id=33) did not make any difference.

If there is absolutely no way around this, then include an empty file that serves this sole purpose - controlling the write access, but for goodness sake, do not rely on some odd side effects.

I could only join the above user(s) in their frustration! Way to waste people's time!

EDIT:
P.S.: Please do excuse my tone, but I can imagine that the time spent on writing this particular piece of code is by no means comparable to the number of users affected by this and the amount of time they wasted trying to figure this out. The impact of this is quite large (just do a random search for issues related to this). Although it is not directly a security issue, it may have led many people to go against common security practices in desperate attempts to fix this (as some "solutions" appear to suggest).

Also, the amount of misinformation being spread regarding this issue, without understanding the actual problem, is quite astounding. There should be absolutely no need to fall back to FTP in this case or to manipulate permissions randomly in hope of fixing the problem (chances are it will not work anyway).

So this should do the trick when the user is www-data:
chown www-data sites/default

I hope this works. Please let me know.

yes it did work

So this should do the trick when the user is www-data:
chown www-data sites/default

works fine,
Thanks


So this should do the trick when the user is www-data:

chown www-data sites/default

 

But with multi-site configuration it must be done over the multisite directory:

chown www-data sites/_multisite_directory_

Rafa Couto (caligari)
GNU/Linux user #99126 - http://bit.ly/LC-99126
GPG key - http://bit.ly/GPG-D76ABDEC

Can you tell me please where this code needs to go? Thanks.

if you haven't figured it out, I was able to figure this out here.
https://help.ubuntu.com/community/Drupal

In terminal, I had to add the -R flag to get the owner to change for all of the module directories.
in my case, it was where all of your contributed modules should go in the
sites/all directory.

sudo chown -R www-data:www-data sites/all

What if you are having same problem with local host? where can you enter the code on mac machine and what would be the code?

There is only one Creator and everything you see is created!

Many many many thanks for solving this issue, I've been searching for good while !
chown www-data sites/default

Solving problems means being smart. Avoiding problems means being wise.

Oh yes. It was a little headache to find the trick. I hope the solution is great saving time for others :)

Rafa Couto (caligari)
GNU/Linux user #99126 - http://bit.ly/LC-99126
GPG key - http://bit.ly/GPG-D76ABDEC

The solution suggested by TheOptimizer has worked for me!

Drupal team, I don't understand how this page hasn't been updated yet! I just installed Drupal (version 7.8) for the first time and it was extremely frustrating that I couldn't figure out how to get a module installed. I'm not sure if ANY of the previous comments have been read by the person who wrote this document or if this one will be read, but the current documentation is very incomplete. The message about FTP needing to be enabled is absurb, but people have already discussed this. Changing my sites/default ownership to www-data wasn't sufficient. I had to follow the instructions on this link to get modules to install on my Debian 6 linux installation:

http://drupal.org/node/244924

More specifically:
[root@localhost]cd /path_to_drupal_installation
[root@localhost]chown -R greg:www-data .
[root@localhost]find . -type d -exec chmod u=rwx,g=rx,o= {} \;
[root@localhost]find . -type f -exec chmod u=rw,g=r,o= {} \;

I have disabled FTP on my server. I have full control of my server, with Drupal, Mediawiki etc installed, and I regard the use of FTP by anybody to be a security issue. I do allow SFTP, but only on request, and for limited periods.

Do Drupal developers believe that FTP is in common usage?

I haven't used Linux in over 3 years and only used it for about 2 years before that so I'm a bit confused by the syntax. I need to run "sudo chown -R www-data sites/all". It took a while but I figured out that "site/all"="the websites' directory". I understand the beginning of the command, from previous experience, but what is "www-data". After reading a comment below, it seems like this may reference the domain of the site and I should actually create a user account named with the domain name on my box. Basically, is "www-data" literal or figurative? If it is figurative, what exactly is it?

~clonerep

I suggest trying 'man chown' if you have access to a Linux box or reading the man page online somewhere.

www-data is the user account that would own the 'sites/all' directory (and everything below it with the -R flag used)

This worked for me:

sudo chown -R www-data sites/all/

Note: That if you are having this problem on OSX you will want to use www instead of www-data. The command below fixed the problem for me.

sudo chown -R www:www sites/all

See comment below re: security from David.

In particular, you should not be doing something like chown www-data sites/default(as several of the above comments recommend) just to make the experience of installing modules easier on your site.

Doing this will make your website less secure. In particular, it will open up the attack surface considerably in the case of a vulnerability elsewhere on your server. Seehttp://drupal.org/node/244924 for more information.

Drupal (and the Update Manager module installation process) will work in this scenario, but that's mainly because it has to. Some servers (e.g. shared hosting) are set up this way and don't give website owners a choice, so Drupal will work with it if it has to, but it's still not recommended. We're also discussing this further at#932110: On some servers, the Update Manager allows administrators to directly execute arbitrary code even without the PHP module and might consider putting some deliberate roadblocks in place to make it a little less easy to install modules via this route.

Installing modules through the user interface is not required, and it's not intended for every site. For the most part, if you don't want to have a poorly-secured server setup and/or you don't already use FTP to manage your codebase, it's not for you. The "Install manually" (since renamed to "Option 2: Upload the module manually") option described in the documentation above still works, just like it always has in Drupal.

I think the documentation isn't too clear on this point (that they are both legitimate alternatives) so perhaps we should edit it to make it a bit more clear.

I just made a number of edits to the page that will hopefully make this more clear. It could probably still use a bit more editing, though.

'chown www-data sites/default' got me past the first hurdle but I also had to add 'chown www-data sites/all/modules' because I received an error about being unable to create insert directory....

you can always do it from command line
cd /var/www/sites/default/modules/
wget http://(module link)
then it'll show up in available modules

chown'ing your system to www-data means your webserver can write to that area now, so any haxor, bot, spammer and whatever can compromise your system now.

Question: With regard to pasting the module URL (from Drupal.org), how does the module upload process work? Does the file first get downloaded by your browser, then uploaded, via FTP, to the website? Or does your web server grab the file from Drupal.org directly, using FTP ?

Question: Why isn't HTTP used instead of FTP when uploading a module file from the interface. Can't a module file just be uploaded to sites/default/files/ and then do stuff with it?

check it.

Nidhi

Hi -

The following comment "The first option will not work on many types of servers, but may be a more user-friendly choice on servers where it does work. " was made in the upload mdule instructions. Can someone please explain why the Drupal module upload interface doesn't work for certain hosting providers? I'm using Bluehost (which is supposed to be recommended by Drupal.org) and the "Install New Module" feature isn't available. I'm trying to figure out if it's a function of the hosting provider, my Drupal configuration (7.14), or if it's just me and my lack of understanding on some of the finer points of Drupal...

If anyone can help, let me know.

Thanks!


I was there as well several years back..The answer, and you know I'm right-and you are going to moan and sigh is

-drop gui and learn some distro of linux command line

your pain goes away;0


I get the following error

The requested page "/?q=media/browser&render=media-popup&types%5B%5D=audio&types%5B%5D=image&types%5B%5D=video&activePlugins=&id=media_wysiwyg&plugins=undefined" could not be found.

looks like the popup with the file selector cant be found

all i get in configuration is
Media
File system
Tell Drupal where to store uploaded files and how they are accessed.
Image styles
Configure styles that can be used for resizing or adjusting images on display.
Image toolkit
Choose which image toolkit to use if you have installed optional toolkits.

im missing
File types
Media browser settings
Rebuild type information for media

does anyone got some good suggestions ?


Took me about half an hour to realise that I needed to go to/admin/config/modules not just /admin/modules. Didn't see the 'Modules' tab on the 'Configuration and Modules' page. It looks greyed out. I thought any options within the Config menu would show up as a sub-menu, but no. I suppose this is the sort of thing you get used to when you've been using Drupal for a while, but it was entirely counter-intuitive to me and I don't know why it doesn't match what was described here and in all the INSTALL.txt files of modules I've looked at.

I also don't know why 'Install new module' doesn't appear. The 'Update manager' module mentioned above seems to be enabled.

I think the behavior you describe was the case way back in the day (when Drupal 7 was under development, well before Drupal 7.0 was officially released).

But in the actual Drupal 7 release, the page is definitely called "Modules" and it's accessible at admin/modules. So the documentation here is correct.


I installed the zip file via the admin panel and enable it.
Now I cannot see my site. I can see : can't open file - and that's all.

Spent 2hours trying to fix this and no joy. I advise all people not to use this module. I have no idea how to get my site back as I've tried every fix I could read.

Not happy.


if possible uninstall the module from the admin console..If you cannot no big deal.
enter

command line

cd into modules folder...Reverify before executing the following command the exact name of the module and then

rm -rf foo.file


Hi,
I am trying to install a module in drupal 7.31 using ubuntu14.04 but getting following error:
Warning: ftp_login(): Login incorrect. in FileTransferFTPExtension->connect() (line 59 of /opt/lampp/htdocs/drupal/includes/filetransfer/ftp.inc).
Failed to connect to the server. The server reports the following message:

Cannot log in to FTP server. Check username and password

i have also tried
sudo chown www-data:www-data -R /opt/lampp/htdocs/drupal/sites
as my drupal is within /opt/lampp/htdocs/ but still getting same errors.

Please help


Using option 1), Update Manager extracts contrib modules in sites/all/module. Where/How can I specify to extract in sites/all/modules/contrib instead ?


In my opinion, this page, and this function is the single greatest flaw in Drupal that confuses more users and drives potential users away. Many new and even experienced Drupal users find the GUI method does not work for them and they end up here, 1- hoping their site has not been scrambled, and 2- painfully trying to figure out which manual procedures to follow, as there are multiple to choose from depending on version of Drupal, and other factors. If this was cleaned up and streamlined so that it simply worked for 90% of all users, it would do more than anything else in getting Drupal more widely adopted.


Ok, so I did not use the official installation method to put Drupal on my Ubuntu server. Instead I used apt-get install, primarily because as a once-upon-a-time Windows user, I find
sudo apt-get update; sudo apt-get -y dist-upgrade
to be almost magical -- even years after first learning it.

The problem is that my directory structure is not exactly as it is described in a lot of these help docs. Drupal is located in (what seems, to me at least, to make more sense) in /usr/share/drupal7 with config files where one would expect config files to live, in /etc/drupal/7/.

Problem here is that /usr/share/drupal7/sites/ is a link to /etc/drupal/7/sites/, which does not (and should not) have a modules folder.

What gives? Where should I put my modules? I understand why they should not go in/usr/share/drupal7/, but can't figure out where to put them!

Please help.


I updated and added new Modules to the site and it was working but it complaint about needing a newer versions and security update.
I updated the Ctools and it is working then I updated File Entity and View modules; now my page is blank.

10 hours later.. tada... ;)
It is working now but because I disabled Commerce and several new modules :(

http://cme4.com/Drupal/

However when I click on various pages, I have to use ?q= on the URL ;(

I know, .htpaccess problems and I have error messages that are not showing up on the page.


When trying to install this module via the modules menu link, I get the following message:Automatic updating of Drupal core is not supported. See the upgrade guide for information on how to update Drupal core manually. Someone please advise.

Thanks.


Did you install this Drupal Core Module manually or did you used the tool from your web hosting site?

Did you back up the database? Did you put your site to Maintenance Mode?
However, I do not think you can do it.

For updating other module, you can do it but make sure:
that you set the $update_free_access = TRUE;
It is in the sites/default/settings.php
Change it back to FALSE


来自 https://www.drupal.org/documentation/install/modules-themes/modules-
7