heroku config:set MONGO_URI='mongodb://address' code example Example: mongodb add on heroku $ heroku addons:create mongolab:sandbox