Locomotive on Heroku in two clicks

If you don't want to read all the manual procedure, click on the button below. It will deploy an instance of Locomotive on Heroku! [![Deploy](https://www.herokucdn.com/deploy/button.svg)](🔗)

## Install the engine locally

Create a new Ruby on Rails app:



Update the Gemfile of the Rails application by adding the locomotivecms gem.



Run the Locomotive installation generator



## Create the Heroku app from your app folder

Heroku toolbelt is required

Visit [https://toolbelt.heroku.com](🔗) to get the installation instructions.



## Setup default Heroku variables

How to get your Heroku API key?

Visit this [link](🔗) and scroll down to the API KEY section.



## Set up a remote Mongodb database

There are currently 2 Heroku add-ons for storing data in MongoDB:

  • [Compose](🔗) (paid plans only)

  • [Mongolab](🔗) (free plan)

Both are really great but since it's free, we'll take Mongolab for the rest of the installation.



## Set up emails

Locomotive needs to send emails and Heroku provides a nice way to send emails for free without configuring a whole mail server on your own. You can find more information [here](🔗).



## Set up Amazon S3

Heroku doesn't offer file storage that's why you need to register to [Amazon S3](🔗).

Unless you modified your **config/initializers/carrierwave.rb file**, Carrierwave should be set up for Amazon S3 in the production environment.



**Note**: For S3 Bucket Region var, here is the correspondance table between your ‘human’ bucket region name, and it’s endpoint:

RegionsLocation Constraint
US Standard *us-east-1
US West (Oregon) Regionus-east-2
US West (Northern California) Regionus-west-1
EU (Ireland) Regioneu-west-1
Asia Pacific (Singapore) Regionap-southeast-1
Asia Pacific (Tokyo) Regionap-northeast-1
South America (Sao Paulo) Regionsa-east-1

## Pre-compile your assets

We suggest you to compile your assets locally so that if there is an issue with your assets, you will be able to debug it more easily.

It is very important that you disable the **initialize_on_precompile** option in the **config/application.rb** file of your application:



Then, in your terminal, run the following command:



## Launch it!

In your terminal,



Then, visit your application