Deploying Meteor on Heroku
03.04.2015
I’m currently working on a shopping-list app for a school project. It’s built on the Full-Stack JavaScript framework Meteor and runs on Heroku. During the deployment I made some notes on how you get a Meteor app up & running.
Meteor uses MongoDB. On Heroku you can add this as a Add-on (mongolab) but you need to add a Billing method to your account.
Setup Heroku for a Meteor app
Go into your meteor app:
cd <yourmeteorapp>
Log in to heroku:
heroku login
Create a new heroku app with the meteor buildpack:
heroku create --buildpack https://github.com/jordansissel/heroku-buildpack-meteor.git
Add mongolab:
heroku addons:add mongolab:sandbox
Set the root url of your app:
heroku config:set ROOT_URL=https://<your_app_name>.herokuapp.com/
Add heroku as a remote of your git repository:
heroku git:remote -a <your_app_name>
Get your MONGOLAB URI:
heroku config | grep MONGOLAB_URI (you need to add a password in mongolab for your app)
Set the output from above as MONGO URL:
heroku config:set MONGO_URL=mongodb://heroku_app0000000000:<hash>@00000.mongolab.com:0000/heroku_app000000
After each change the heroku app should automatically restart.
Deploy new commits to your heroku app:
git push heroku
Additional notes
Check the logs if everything is alright:
heroku logs
Open heroku app in your browser:
heroku open
Now you should have your Meteor app up & running on Heroku. Heroku really makes deployment easy and fun!
EDIT 10.05.2015: Added correct heroku buildpack command.