Skip to main content

Deploy Metoer App on Heroku in 8 Steps

Thinking about Staging server for testing your Meteor Applications and could not decide which one to choose from a variety of costly options then here is a solution for you. Everyone have to find an alternative to the issue he/she faces, So here is the perfect alternative if you don't want to pay bucks for testing your meteor app over the cloud. Heroku has the answers to solve all of your problems.

Heroku?
Heroku is a cloud platform that lets companies build, deliver, monitor and scale apps — we're the fastest way to go from idea to URL, bypassing all those infrastructure headaches.

 Here I will share the steps with which I overcome the issues by settling it up on Heroku.


Prerequisites: You should have running meteor app on local Server.


Step 1: Install Heroku Belt.
For Windows: Meteor installerFor Linux/Mac: Heroku Toolbelt

Step 2: Create a Git Repo of your project. There are also other options available you could check on your Heroku dashboard.
Step 3: Connect your app with Git.
Heroku Options
Step 4: Now Deploy your changes to your repo. Make your you are in the root folder of your App.

$ heroku login
// add your credentials here
$ git add .
$ git commit -am "make it better" 
$ git push origin master ( Push changes to your git repo first)
Step 5: Database connectivity.
Heroku also offers Database connectivity as one of its free plug-ins but you need to 
provide your credit card details for that. It's ok If you have a credit card but 
if you don't have one then the preffered options in mLab.com.
Mlab?
mLab is the largest cloud MongoDB service in the world, hosting over a half million deployments on AWS, Azure, and Google. Get started with a free database.
Meteor.com also suggests this in its documentation. It also provides free databasse upto 512 MB for free.
Create an account on Mlab.com
After creating account, create a database and create users for database.


Step 6: Connect Database.
To connect this DB with your heroku app you need to provide a MONGO_URL.

Add your user and password here.
mongodb://<dbuser>:<dbpassword>@ds111078.mlab.com:11078/meteor


and specify that url in config variable in settings of Heroku dashboard.

Step 7: Add BuildPacks to Heroku.
Consider buildpacks as the compiler as Heroku does not have the compiler for Meteor JS app, So you need to provide a git repo for this and the Git Repo for Metoer Build pack is 

Step 8: Push changes to Heroku
$ git push heroku master 

I hope this would help you in settling your Meteor App over the cloud.


Comments

Popular posts from this blog

Meteor JS REST API

WRITE A POST Shahid Shaikh FOLLOW Engineer, Blogger from Mumbai. RESTful CRUD Operations in Meteor.js Published Dec 31, 2015 Last updated Jan 19, 2017 Introduction Meteor is a popular framework for building real-time web applications. We have already covered a tutorial which explains  how to build chat system using Meteor.js . In this tutorial, we will learn how to develop a RESTful API using Meteor which perform CRUD operations. Creating new project Create a new meteor project using the following command: meteor create appName Choose an application name of your choice. Once Meteor is done creating the project, you will see the directories and files created by Meteor in the folder name. We will not need them as of now, so we will delete all of those files and create whatever we need in the coming section. Installing iron-router In order to perform routing in Meteor, we will use  this awesome...

Meteor Mongodb Mup Commands

docker exec -it mongodb mongo docker cp mongodb:dump/ce5-meteor . If deployed with mup, you are in luck. You can find the steps here:  https://github.com/xpressabhi/mup-data-backup Here are the steps again: MongoDB Data Backup deployed via mup These commands run well only if meteor deployed with mup tool. Mup creates docker for mongodb hence taking backup becomes easy with these commands. Backup Take backup of running app data from docker then copy to local folder out of docker. docker exec -it mongodb mongodump --archive= /root/m ongodump. gz --gzip docker cp mongodb : /root/m ongodump. gz mongodump_$ (date +%Y-%m-%d_%H-%M-%S). gz Copy backup to server Move data to another server/local machine or a backup location scp /path/to/dumpfile root@ serverip : /path/ to/backup Delete old data from meteor deployment Get into mongo console running in docker then drop current database before getting new data. docker exec -it mongodb mongo appName db. runCommand ( { dropDatabase : 1 } ) ...