Last Updated: February 25, 2016
· kazlan

Deploying Meteor app to heroku with Meteorite and MongoLab

It's been a bit of a hassle to deploy my Meteor (0.6+) apps to heroku, so I thought I'd share my history and recipe..

I'll presume you already have your Heroku and MongoLab accounts setup as well as git set on your box. Make sure you installed Heroku toolbelt too..

This was my first try
heroku create <appname> --stack cedar --region eu --buildpack

that buildpack is no longer valid and will fail (until rPowell's pull request is accepted), it tries to bundle with 'meteor' instead of 'mrt' and throws and error

heroku create <appname> --stack cedar --region eu --buildpack

This one works but sets up MongoHQ local vars and installs the Heroku plugin. So you need to uninstall the plugin and set your MONGOURL var to point to your MongoLab DB which is a bit of a hassle_

So I forked the buildpack and made it DB agnostic. Now it works like a charm. I'll detail the process.

git init
git add .
git commit -a -m "first deploy"
heroku create <appname> --stack cedar --region eu --buildpack  __Set appname and region as needed__
heroku config:set MONGO_URL=mongodb://<username>:<password><dbname>
heroku config:set ROOT_URL=<appname>
git push heroku master

As of version of Meteor I needed to add the following to package.json in the root directory of the apps

  "name": "App_Name",
  "Version": "0.1",
  "engines": {
    "node": "0.10.20"

All set and deployed!

Hope it helped

9 Responses
Add your response

I don't have a heroku / mongolab account yet, but I've been wanting to... since I am a big Meteor fan, this tip will help me to pull that trigger :) thx!

over 1 year ago ·

$ heroku create is missing --buildpack before the GitHub URL.

over 1 year ago ·

Indeed, thanks. Just fixed :)

over 1 year ago ·

@Jorge I get an error and the logs show the following. fibers.node is missing. Try reinstalling node-fibers?

over 1 year ago ·

as of version I needed to set "node": "0.10.20" in package.json to get thru that problem.. will add an example package.json to the tip.

over 1 year ago ·

Thanks @kazlan. Life on the bleeding edge! I am running the latest Meteor, pushed it to Heroku with Node 0.10.20. Got an Application Error. Logs said Meteor needs Node 0.10.21. Fired up a new node box and now my inital push fails with a SyntaxError: Unexpected token ILLEGAL when installing meteorite. Will I ever get my Meteor app on to Heroku.....

over 1 year ago ·

got me there.. My last one was a app, will try it up tomorrow with a new one and see what happens.

over 1 year ago ·

I forked your buildpack and made the needed updates for Meteor and Node 0.10.21 as done by

File comparison:

My buildpack:

over 1 year ago ·

Here are instructions for hosting Meteor 0.8.2 on Heroku, which can be challenging the first time around:

over 1 year ago ·