Hosting Grav on Heroku

Hosting Grav on Heroku

10, Apr 2016 André Kolell

When I had to host a little web app with RabbitMQ and PostgreSQL some years ago I met Heroku for the first time. Heroku is a PaaS which makes a developer's life much easier, as it allows to focus on development instead of setting up and managing servers and infrastructure.

Another thing that's great with Heroku is, that it makes you a better software developer because it enforces you to work according to the twelve factor app methodology.

Using Heroku for hosting a Grav website has a massive disadvantage: Heroku is a flat file CMS, meaning all pages, all users, all visitor logs etc. - everything - is stored on the file system, which conflicts with the twelve factor app rule of stateless processes. The consequence is, that you should neither manage the contents of your Grav's CMS online at Heroku nor could you rely on the logs collected by Grav.

But this doesn't mean that hosting Grav on Heroku isn't possible or a bad idea per se: I'm developing this Grav website on my local machine. Whenever I have finished something that I like to see online, I create and push a new release to github, which is - thanks to Heroku's GitHub integration - deployed automatically and my local version gets online within seconds.

Further steps to take can involve moving parts of Grav's configuration to environment variables, using Google Analytics or Piwik for web analytics (since we cannot rely on Grav's logs as Heroku's file system is ephemeral) and becoming popular to leverage Heroku's feature of scaling out by starting additional web containers... ;-)

Blog Comments powered by Disqus.

Next Post Previous Post