grails (11) vaadin (11) meteor (6) java (4) elasticsearch (3) apple (2) centos (1) cloudbees (1) google analytics (1) gradle (1) heroku (1) javafx (1) javascript (1) jdbc (1) jug (1) logback (1) logging (1) mac os (1) management (1) mongodb (1) mongolab (1) mysql (1) twitter (1) ubuntu (1)

Sunday, May 26, 2013

How to deploy Meteor on Heroku with external MongoDB

The case is following, you have made a Meteor application and you want to deploy it on Also, you want to use external MongoDB database provided by
  1. Register at 
  2. Install Heroku Toolbelt from
  3. Register at and create new MongoDB database (they give 500MB for free)
  4. Open the root folder of you Meteor project in console (you need a Git repository in order to deploy applications to Heroku, just set up one or use the one provided by Heroku, it becomes accesible after you create new application)
  5. Login to the Heroku from the command line: $ heroku login
  6. Create new Heroku application: 
    $ heroku create <appname> --stack cedar --buildpack
  7. Setup other than default MongoDB for your Meteor application (you can get all the details for constructing the MONGO_URL from yours Mongolab account): 
    $ heroku config:set MONGO_URL=mongodb://<username>:<password><dbname>
  8. Set the root URL
    $ heroku config:set ROOT_URL=http://<appname>
  9. Or this, in case you have got a domain
    heroku config:add ROOT_URL=
  10. Add the Heroku Git repository as another remote to your git repository and push the code to that remote. The application will be automatically deployed and becomes accesible on <appname> 
    $ git remote add heroku<appname>.git
    $ git push heroku master
When you make changes to your code, just run git push heroku master again and all the commit from your origin/master will be released.

In case you want to see the response times for this setup, you can try it out on or