How To Install Drupal With Drush?

How To Install Drupal With Drush?

Install Drupal With Drush

Drush is a command-line interface that allows us to complete administrative and development activities for Drupal websites more quickly. After installing this Drush, we will be able to carry out useful tasks by simply typing a command into a terminal. These operations are ones that would normally need a number of steps to carry out in a web browser. Drush is compatible with Drupal versions 6, 7, and 8.

Please take note that Drush 8 is required for Drupal 8 to function.

The following is a list of activities that can be completed quickly and easily by utilizing Drush:

  •     Get Drupal here.
  •     Get the contributor modules here.
  •     A Drush Install Drupal and bring its version and those of any contributed modules up to date.
  •     Execute “updatedb”
  •     Delete all stored data.
  •     Start the cron job.
  •     Drupal should be run using a webserver that isn’t too heavy.
  •     Configuration import, export, and merge capabilities
  •     Create new users and assign roles to them.
  •     Include authorizations in the roles.
  •     Drupal data should be backed up and restored.
  •     Make a copy of your database and any files you need on a separate server.
  •     Create a compilation of twig templates.

The first thing you need to do is launch a window for the terminal. Users of macOS and Linux should be familiar with the command line or terminal, but if you work with Windows, it’s possible that you haven’t had much experience with either of these.

On Linux and MacOS, the terminal comes pre-installed, but if you’re using Windows, you’ll almost certainly need to download some additional software before you can use Drush. Installing “Git Bash” is something that we would suggest doing in this case. If you haven’t already, go to Google’s website and download the Git for Windows package. Then install it on your computer. This is the most advanced terminal application that is compatible with the Windows platform.

When you have your terminal window open, the next step is to become comfortable with the shell commands that you will need to use. If you are new to using the command line, you should try using the ls command to list the files in the current directory, the cd command to move directories, and the pwd program to display the directory that you are now in (print working directory).

At first, using the command line could make you feel odd, but as you get used to it, you’ll find that it really helps to speed up the processes you need to perform.

How to Install:

Development of Drupal 8 due to the necessity of Drush 8. When it comes to installing Drush, using Composer is by far and away the easiest technique.

Install Composer in a global context first.

$ curl -sS | php

$ mv composer.phar /usr/local/bin/composer

Now, add the directory that contains Composer to your path by changing your.bash_profile file.

$ export PATH=”$HOME/.composer/vendor/bin:$PATH”

Simply re-source the configuration you just added or reload your terminal.

$ source ~/.bash_profile

Installing the most recent version of Drush is something you can do now that Composer is operational.

$ composer global require drush/drush:dev-master

Maintain Drush’s current knowledge.

$ composer global update

Notwithstanding this, it will install the most recent version, 8.0.3.

After that, you can check to see if the update was successful by issuing the following command:

$ drush –version

Let’s get started with Drush right away. Drush will be utilized initially for the downloading, installation, and operation of Drupal 8:

Step 1: is to get the most recent D8 branch that is currently accessible.

Drush dl drupal-8 –select 

Drush dl drupal-8

Choose the suitable branch for the development, as I had chosen 2 previously, and press the Enter key.

To download D7 branch

drush dl drupal-7 –select

in a manner comparable to d8, choose the appropriate branch for the development, and then press the Enter key.

drush dl drupal-7

When we are finished with the branch selection process, we will be given specific information regarding the profile and the modules that are available on that branch.

Drush dl drupal

Step 2: The next thing you need to do is make a database. We are able to construct the database and log in to MySQL through the use of the command line.

mysql -u root -p

Make a database called dbname;


Step 3: Now that the database has been built, let’s proceed with the installation of Drupal.

drush si standard –db-url=mysql://[db_user]:[db_pass]@[ip-address]/[db_name]

In this line, we are passing a standard profile, the name of the Drupal profile that we wish to install, our MySQL username and password, and the name of the database that we have just established.

The prompt containing the message will appear once we have executed the command above.

“You are about to create a /var/www/html/drupal-8.0.2/sites/default/settings.php file and DROP all tables in your ‘d802’ database. Do you want to continue?”

where d802 is the name of a recently developed database.

If you press the “y” button, the Drupal installation will begin using the default profile.

Drush will now generate a random password and show you the following message:

The installation is finished.  The username is admin.  The password for this user is: HUoe2kei4o   [ok]                                                  

You’ve successfully installed Drupal; congratulations!

installed Drupal

Step 4: Give the settings.php/files folder permissions of 766 on the one hand and 777 on the other for purposes of security.

chmod 755 settings.php

chmod 777 files

We finished all of the Drush-based tasks to successfully install Drupal. Now that Drupal has been successfully installed, we can view it in the browser.

install Drupal


We hope that through this post you were able to gain knowledge on how to install Drupal with Drust.

Additionally, you should check out Appic Softwares if you’re looking for a Drupal development company that can assist you with all of your Drupal-related solutions. You will receive help from our skilled team of Drupal developers.

Even better, you can employ our team of committed Drupal developers to oversee your project. What are you still holding out for?

Contact us now!

Get Free Consultation Now!

    Contact Us

    Consult us today to develop your application.

      Get in touch with us

      Skype Whatsapp Gmail Phone