Putting Apps on Heroku

Date posted
5 December 2012
Reading time
4 Minutes
Stephen Mahood

Putting Apps on Heroku

Recently I spent some time at home working on a tool for testing JavaScript regular expressions, which lives on: http://jsregex.herokuapp.com (and I'm sharing it on Github as well).

 src=

Whilst the actual JavaScript is fairly straight forward, a couple of people asked about how I put it onto Heroku and it works, so I thought I'd write a bit about that. I find that Heroku is absolutely brilliant for hosting small apps online to share. Their free plan is usually more than enough for small sites or prototypes. Whilst I have used it for Node.js applications, the most common use case is for Ruby, usually with some form of framework, most commonly a fully fledged system like Rails, or a lighter framework like Sinatra. Note that to use Heroku, your project needs to be a Git repository.

When I first started with Heroku it did seem complicated and quite intimidating as to how it all works, but in reality it's actually really simple and straightforward to work with. It's often more efficient to just install the command line Heroku tool (Windows/Mac/Linux), and then log into Heroku through the command line. You can then run `heroku create` to create a new .herokuapp.com subdomain. If you want to name the subdomain, you can just run `heroku create jack` to get jack.herokuapp.com (if no one else has, of course).

Heroku then behind the scenes adds a new Git remote, and to push to Heroku you simply need to run `git push heroku master`, and Heroku does the rest.

If you've got a small app you need to show someone, or test, I really can't recommend Heroku enough. The free plan has some limitations (in terms of load/concurrency/etc), but for demos it's usually sufficient. Production pricing is granular and on a pay-as-you-use basis.

If you'd like to try it, I recommend the Heroku Quick Start guide, as it contains all the information you'll need to get something online.

About the author

Stephen Mahood