DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Frameworks
  4. Deploying Drupal to heroku

Deploying Drupal to heroku

Tim Millwood user avatar by
Tim Millwood
·
Apr. 01, 14 · Interview
Like (0)
Save
Tweet
Share
11.12K Views

Join the DZone community and get the full member experience.

Join For Free

Although not advised, it's actually possible to get Drupal up and running on Heroku.

First download Drupal, this is easy with drush

drush dl drupal

and install the Heroku Toolbelt. Then cd into the Drupal directory, make it a git repo and push to heroku

git init
git add .
git commit -m "initial commit"
heroku create
git push heroku master

The heroku open command will open your app in the browser, you should see the drupal installer, but we don't need this, we need to manually add settings.php and commit it to git.

heroku addons:add heroku-postgresql
heroku config

This will give you the database details you need to add to settings.php. We also need to remove (or edit) the gitignore file to let us commit settings.php.

rm .gitignore
cd sites/default
cp default.settings.php settings.php

Edit settings.php to add the database details, then commit and push to Heroku.

git add -u
git add *
git commit -m "adding settings.php and removing gitignore"
git push heroku master

Running heroku open will open your app with an error page. Add /install.php to the end of the URL and run through the Drupal installer. On the third step you will see a warning about "Unicode library". This is because the default Heroku PHP buildpack doesn't have mbstring, however you can roll your own buildpack or use a third-party one to add mbstring. For now, just click "proceed with the installation". After completing the installer you will get logged into your site and can start using Drupal.

Due to Heroku's ephemeral filesystem all files Drupal creates will not be stored if the dyno is stopped or restarted. Also some pages such as "/admin/reports/status" and "/admin/config" cause timeout errors. This issues could be resolved by creating a custom buildpack and copying all Drupal generated files to Amazon S3. Although, there are better solutions for Drupal hosting, so maybe not worth the effort.

Have fun!


Drupal

Published at DZone with permission of Tim Millwood, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Important Data Structures and Algorithms for Data Engineers
  • The Beauty of Java Optional and Either
  • What’s New in Flutter 3.7?
  • DevOps for Developers — Introduction and Version Control

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: