Configure Drush Deploy For Deploy Drupal Painlessly

Drush deploy is a deployment framework built on Drush. It is heavily influenced by capistrano.this help us to deploy our code in a way that will cause minimal/no downtime, and let us to easily rollback when problems occurs.


  • PHP 5.3 or above
  • Only support for GIT
  • Drush 7


Drush Deploy installation is pretty simple what we need to do is just clone the drush deploy frame work to .drush folder as below

cd ~/.drush
git clone --branch 7.x-1.x
drush cc drush

NOTE: after clone you need apply the following patch for drush deploy in order to get the drush deploy work with out errors.

Setting up Drush Deploy

Here what we are going to do is we are going to deploy the code for a remote server with the GIT repository so for that we have to create a aliases.drushrc.php and deploy.drushrc.php file


Typically this file is used to setup the aliases for the drush deploy as below, in this example we are creating this file on .drush folder you can create that files under sites folder of the drupal root as well

$aliases['site1'] = array(
 'root' => '/home/mimran/drush-deploy',
    'remote-user' => 'mimran',
    'remote-host' => '',


This file used to carry the drush deploy settings as follow

    $options['application'] = 'drush-deploy';
    $options['deploy-repository'] = '';
    $options['branch'] = "master";
    $options['keep-releases'] = 3;
    $options['deploy-via'] = 'RemoteCache';
    $options['docroot'] = '/home/mimran/drupal-site-1';

Initialize Drush Deploy

Once done withe drushhrc files setup we can initialize the drush deploy on remote servers by typing following command

drush deploy-setup @site1

as a result you can see following folder structure on your remote server

After that you can use following command to deploy your code to server when ever you want deploy

drush deploy @site1

In case you want to rollback you can use following command

drush deploy-rollback @site1