Heroku

Heroku is a Platform-as-a-Service (PaaS) that simplifies deploying your apps online.

Installation

Assuming that you have an Heroku account (sign up if you don’t), let’s install the Heroku Client for the command-line using Homebrew.

  1. $ brew install heroku-toolbelt

The formula might not have the latest version of the Heroku Client, which is updated pretty often. Let’s update it now:

  1. $ heroku update

Don’t be afraid to run heroku update every now and then to always have the most recent version.

Setup

Login to your Heroku account using your email and password:

  1. $ heroku login

If this is a new account, and since you don’t already have a public SSH key in your ~/.ssh directory, it will offer to create one for you. It will also upload the key to your Heroku account, which will allow you to deploy apps from this computer.

If it didn’t offer create the SSH key for you (i.e. your Heroku account already has SSH keys associated with it), you can do so manually by running:

  1. $ mkdir ~/.ssh
  2. $ ssh-keygen -t rsa

Keep the default file name and skip the passphrase by just hitting Enter both times. Then, add the key to your Heroku account:

  1. $ heroku keys:add

Usage

Once your keys are in place and you are authorized, you’re ready to deploy apps. Heroku has a getting started guide, which has all the information you need (the one linked here is for Python, but there is one for every popular language). Heroku uses Git to push code for deployment, so make sure your app is under Git version control.

A cheat sheet for deployment:

  1. $ cd myapp/
  2. $ heroku create myapp
  3. $ git push heroku master
  4. $ heroku ps
  5. $ heroku logs -t

The Heroku Dev Center is where you will find more information.