How Deploy Drupal to Heroku

How Deploy Drupal to Heroku

Posted on Thu, 01/26/2017 - 23:26 by zhilevan

what is Heroku? It’s a service for developers eager to get their applications online without having to worry about infrastructure details. Metered, pay-as-you-go Cloud Computing services come in all kinds of flavors. Infrastructure as a Service (IaaS) offerings like AWS allows enterprises to shift their entire operations away from traditional data centers. The downside is that you’ll have to manage networking and provisioning yourself. On the other hand, Platform as a Service provider like Heroku, offer abstracted environments into which developers can simply drop their code and let the platform take care of the provisioning details. You’ll give up some control, but gain simplicity and speed in exchange.

As Heroku describe itself:

Heroku is a cloud platform that lets companies build, deliver, monitor and scale apps — we're the fastest way to go from idea to URL, bypassing all those infrastructure headaches.

In this article, I explain how to deploy Drupal projects into Heroku,

First download Drupal, the easy and straightforward solution for a Drupalist is do  it with Drush.

For latest stable version of Drupal 7

drush dl drupal-7


For latest Stable version of Drupal 8

drush dl drupal-8

In order to use Heroku service you require create a new account ( if you don’t have ) Then you need to install Heroku CLI , install adequate Heroku-cli version according to your OS. Then change directory ("cd drupal 8.2.5") to your downloaded Drupal ( or exists drupal ), make a git repo and push your files to Heroku git repository via

git init
git add .
git commit -m "initial commit"
heroku create [your-app-name]
git push heroku master

By default Heroku support Postgresql database  and don't need you to install anything,

Note: if you don’t specify a name for your app, Heroku generate semi-random name for it, as example, my app name is “hidden-bastion-55935”

And if you want to use MySQL  Try to use a MySQL addon like cleardb .

Running  “heroku open” will open your app on the browser, in this situation will open on the browser and Drupal installation step. Complete Drupal installation steps and hooray, your Drupal website is Ready.