Deploying Meteor and MongoDB to Heroku


I am attempting to deploy my project to Heroku following a particular guide (

One of the steps states that

var mongo_url = process.env.MONGOHQ_URL;

Needs to replace "MONGO_URL" in server/server.js.

The problem is I can't find that variable at all, the only mention of that variable is in the following code

    // check for a valid MongoDB URL right away
    if (!process.env.MONGO_URL)
         throw new Error("MONGO_URL must be set in environment");

Does anybody have any experience with this, or know where to find "MONGO_URL in order to change it?

10/31/2012 7:40:22 AM

I would suggest that instead of using the article you mentioned as a guide that you do the following:

Use Meteorite to build and run your local Meteor projects:

Instructions are on that page.

Then use this buildpack:

Again, the README has how to create your app on Heroku (a one-liner)

The NOTE at the bottom of this README means that you need to verify your Heroku Account with a payment card so that you can add the mongohq:free add-on to your app. Once verified run:

heroku addons:add mongohq:sandbox

To add the db on Heroku.

Then the other step is to set the ROOT_URL for you app, type this inside your local app directory once the app is committed (only the first time):

heroku config:set ROOT_URL=<<domain of your app>>

Unless you are using a custom name <> will be something like

If you then run:

heroku config

you will see that MONGOHQ_URL has been set alongside BUILDPACK_URL and ROOT_URL.

2/1/2013 1:08:15 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow