Deploying Meteor App to Heroku
Follow the steps bellow to get this project running on Heroku for your personal testing.
Required softwares:
- Meteor – Download it from here: https://www.meteor.com/install
- Heroku – Download it from here: https://toolbelt.heroku.com
- Git – Download it from here: https://git-scm.com/downloads
- Upload your project to Github.
- Clone github project to your computer.
- $ git clone https://github.com/ACCOUNT_USERNAME/NAME_OF_PROJECT.git
- Navigate to the cloned folder.
- In windows: $ cd meteor-app-todo-list
- $ heroko login
- Fill up credentials
- If you do not have an account yet, you can register for one at http:/heroku.com
- $ heroku apps:create NAME_OF_PROJECT
- Creates the project depending on the name provided.
- Set Buildpack for Heroku Instance
- $ heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git
- Meteor needs a buildpack in order to be executed by the Heroku dyno manager. As Heroku’s cedar stack has no default language/framework support, the buildpack determines the framework for us. Unfortunately, Heroku does not have official Meteor support. To get around this, we will use a third-party custom buildpack.
- $ heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git
- Create a new mongodb instance
- $ heroku addons:create mongolab:sandbox
- Add Environment Variables in heroku:
- $ heroku config:add MONGO_URL=<MONGODB_URI value>
- You can get MONGO_URL by running: $ heroku config
- $ heroku config:add ROOT_URL=https://NAME_OF_PROJECT.herokuapp.com
- $ heroku config:add MONGO_URL=<MONGODB_URI value>
- Check if we can push to heroku:
- $ git remote -v
- Should give you a list of git URLS (github and heroku github).
- if heroku link is not in the list, you can manually add it like this:
- $ git remote add heroku https://git.heroku.com/NAME_OF_PROJECT.git
- $ git remote -v
- Deploy our code:
- $ git push heroku master
Optional
- Deploy app to your mobile device using Heroku project URL as server:
$ meteor run android-device –mobile-server https://YOU_HEROKU_APP_SLUG.herokuapp.com/
Do you need help with a project? or have a new project in mind that you need help with?
Contact Me