I am looking to download and install a module using the Linux command line.

How can I do this?


6 Answers 6

  • You can install Drush (see Installing Drush on Ubuntu or How to install Drush server-wide in less than one minute); after, you can install a module with drush:

    • to download a module

      drush dl modulename
    • to enable the module

      drush en modulename
  • Also, you can use wget to download the module, and make a directory inside the modules directory (in this case the modules directory is /home/youruser/public_html/sites/all/modules/).

    wget http://ftp.drupal.org/files/projects/modulename-6.x.tar.gz
    mkdir -p /home/youruser/public_html/sites/all/modules/modulename
    tar -zxf modulename-6.x.tar.gz -C /home/youruser/public_html/sites/all/modules/modulename

Enable the module in "Administer > Site building > Modules."

  • 1
    I liked that you provided both the options with and without drush.
    – pal4life
    Aug 16, 2011 at 19:03

To install Drupal modules using command line, you have to install Drush Composer on your machine.

So use this link to install Drush using composer : https://github.com/drush-ops/drush

After installing it, open your terminal and go to your project/drupal directory into which you want to download modules.

To download and enable modules using a single command, run following command:

drush en -y your_module_name

Note : your_module_name should be the name present on the url of the module name like https://www.drupal.org/project/your_module_name


The best way to do this is via the Drush project. This will allow you to download and enable modules via the command line similar to the code below.

# Download the Views module
drush dl views

# Enable the Views module
drush en views

If you don't have (or don't want) drush, you can also just do something like this:

$ cd $MY_DRUPAL_SITE_ROOT/sites/all/modules
$ wget http://ftp.drupal.org/files/projects/querypath-6.x-1.6.tar.gz
$ tar -zxvf querypath-6.x-1.6.tar.gz

(the -z flag to the tar command does a "gunzip" of the file before untarring)

From there, you can go to the Site Building -> Modules screen and install the module there.

That said, if you are going to be doing this a lot, Drush is very helpful


Install drush, which is a command line tool for Drupal. Downloading and installing a module would just need you to execute two commands. (The first command download the module, and the other one installs it.)

drush dl <modulename> 
drush en <modulename> -y

These commands will take care of module dependencies too.

  • @ arpitr -thanks for your response,already my drupal 7 is running .again i want to install drush?
    – DINE
    Sep 14, 2015 at 5:21
  • drush is independent. After installation you just need to run drush commands inside drupal installation directory, there are other cool stuff you can do with drush drushcommands.com/drush-7x
    – arpitr
    Sep 14, 2015 at 5:24

1- By using cyber duck tool we can import any thing into linux server from windows.using ip,username,password,port. http://www.v3.co.uk/v3-uk/download-review/2032496/cyberduck-windows-v401

2- wget http://ftp.drupal.org/files/projects/modulename-7.x-1.0-rc2.tar.gz

 mkdir -p /home/force_password_change-7.x-1.0-rc2.tar.gz -C /home/www/html/transgenic/sites/all/modules/modulenmae

procedure -open terminal and give the download link adrress(above format) it will download save on desktop and follow second command and you can able to see your module,in modules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.