Using Locomotive CMS on Heroku

December 13, 2015
on
heroku

So I was given the popular task of creating a site for my sister. It had to be
simple enough for her to make edits, upload images, free to host and most
importantly low maintenance -- I don't want to spend time ironing issues.

What skittered to mind was, Heroku for hosting and a Rails CMS for edit content managing. I
don't want to do PHP so Wordpress was not an option.

What You'll Need

Don't Use Locomotive V2

So the first thing I noticed was there were two versions of Locomotive, v2 and
v3. I initially used v2 but it was so old and unsupported, I quickly gave up.

Locomotive v2 only supports mongoid 3 which is too old for mongodb 3. On Heroku only
mongodb 3 is given out for free, if you want the older mongodb 2 you'll have to pay for
it. So, let's dive into the unreleased v3 Locomotive.

Create Locomotive V3 Instance

The Locomotive team was smart enough to create an instant deploy tutorial.
I followed the tutorial, launching the Heroku deploy script and so now the next step is to pull the Locomotive code from
Heroku to Github.

For some reason the Gemfile had to be uncommented, then I could bundle
install.

bundle install
wagon serve

wagon serve will run the develop server to let you preview your site.

wagon push production will push whatever you have to production.

That's all you really need to know. You can learn more about how all this works here.

Development Workflow

You will be spending your time inside the wagon adding data, fields, layout
changes. Surprisingly the only thing you need to push to Heroku directly is only when
you want to update the Locomotive version.

Setting Up The Domain

The last step is to make the domain point to the Locomotive site. I use
NameCheap, and here is what I did.

CName www to Heroku app url. Redirect root to www

Creating An Account For The User

The very last step is to create an account for the editor. There are two
options in Locomotive author and designer. I honestly don't know what the
difference is, I just picked author.