If you live outside the US or Europe, chances are you cannot provision some addons to your Heroku application. If you try to create one using the heroku config comand, you end up getting:
$ heroku addons:create mongolab:sandbox
Creating mongolab:sandbox on ⬢ radiant-stream-99649… !
▸ Please verify your account to install this add-on plan (please enter a credit card) For more information, see https://devcenter.heroku.com/categories/billing Verify now at
The default heroku command:
$ heroku addons:create mongolab:sandbox does not work.
If you try to add it from the web interface, same thing:
Even so, it is still possible to add the mLabs addon to your application on Heroku. You can do it via your mLabs account:
1) Head over to https://mlab.com and create an account or log in;
2) In the Home screen, click “Create new”:
2.1) Select ‘Sandbox (Free)’:
2.2) Pick a region;
2.3) Give your DB a name;
2.4) Submit your order (should be $0.00)
Your DataBase should be created. Then go ahead and..
3) Click on your just-created DB;
4) Create a user:
5) After it has been created, use the information mLab gave you to fill out the MONGODB_URI variable line displayed above, replacing <dbuser> and <dbpassword>.
6) Set it up as a Heroku environment variable from your terminal :
You should then configure the environment variable by hand with:
$ heroku config:set [MONGODB_URI-provided-by-mLab]
in my case:
$ keroku config:set mongodb://mlabs_guest:<dbpassword>@ds264255.mlab.com:59255/test-database-d
This image shows how I set mine up for another project:
That should be it: now your MONGODB_URI is set and configured, and you can now connect it to heroku.
Good luck with your project,