February 18, 2025
Now, it’s time to get your hands dirty. Ready? I’m going to show you how to deploy and scale your Meteor App. FYI: This is one of two topics of our 2nd Meteor Meetup on July 9th, 2016. The author is Tai Nguyen, a young talent member of Designveloper.
Deploying a Meteor app, however, bears a strong resemblance to deploying other kinds of software, and is much easier, especially when you are familiar with working on a WebSocket-based Node.js app.
Since it is a must to bring your app into play after all of your effort to develop, I would love to dig deep into what you should take into consideration before deploying. In this blog, I am going to list some of the essential stuff like this, including deployment environments, variables, domain name, SSL certificate, and CDN.

Deployment environments in Meteor include three server tiers that are Development, Staging, and Production:
Deployment environments can explain in great detail at:
Please check out the list of "Meteor for Beginners - Easy and Practical" videos:
Make sure environment variables and settings all are available for your deployment process.
One reliable destination for getting variables is https://nodejs.org/api/process.html#process_process_env
meteor run --settings settings.json.Remember to register a domain name for your site, so that users can access your site. Then, it is absolutely necessary for you to generate an SSL (Secure Sockets Layer) certificate.
CDN (Content Delivery Network or Content Distribution Network), in spite of being optional, should be set for your site. With CDN, content and images will deliver to end-users with high-quality and high performance
Read more at https://guide.meteor.com/deployment.html#cdn. That brings me to the end of this blog. In the next blog, I am going to show you how to deploy a Meteor app in reality. Stay in touch and I will keep you updated.
FURTHER READING: |
1. GraphQL vs Rest Which One Is Better? |
2. The 10 Programming Languages Used by Top Companies |
3. What Is Python Programming? The Best Programming |

To begin with, I create 4 servers in AWS (Amazon Web Service) with 4 different IP addresses:
I have chosen the domain which is www.ami.com for the app. I use MongoDB because it is the default database of Meteor. There we’ve got:
Replication sets provide redundancy and increase data availability on different database servers. Hence, I apply replication to increase the performance of reading operations.

At first, I create an admin user following precise instructions on https://docs.mongodb.com/v2.6/tutorial/add-user-administrator/ and generate a key-file by doing exactly guides on https://docs.mongodb.com/v2.6/tutorial/generate-key-file/
Next, I apply SSH (Secure Shell) to all 4 servers and run the following commands
>cd ~/
> mkdir mongodb/
> screen -S mongodb
> mongod --dbpath mongodb/ --replSet Ami --auth --keyFile mongo-keyfile
To close the terminal session, I use the hotkeys “CTRL + a + d”.
Then I turn 54.174.9.184 into primary MongoDB by running the following commands:
> mongo
> use admin
> db.auth(‘admin’, ‘password’)
> rs.initiate()
> rs.add(‘54.174.9.185:27017’)
> rs.add(‘54.174.9.186:27017’)
> rs.add(‘54.174.9.187:27017’)
In order to set up the app, the first thing I need to do is to install meteor up by using npm. Below is the command line to use:
> npm install -g mup
Setting up is a must. To do this, use the cd path command to go to the folder which contains the settings file of the application:
> cd path/to/settings
> mup init
This is how I scale the app. In this file, I edit the mup.json file by:
{
"host": "server-1.ami.com",
"username": "ubuntu",
"pem": "./ssh.pem",
"env": {
"CLUSTER_ENDPOINT_URL": "https://server-1.ami.com",
"CLUSTER_BALANCER_URL": "https://server-1.ami.com"
}
},
{
"host": "server-2.ami.com",
"username": "ubuntu",
"pem": "./ssh.pem",
"env": {
"CLUSTER_ENDPOINT_URL": "https://server-2.ami.com",
"CLUSTER_BALANCER_URL": "https://server-2.ami.com"
}
},
{
"host": "server-3.ami.com",
"username": "ubuntu",
"pem": "./ssh.pem",
"env": {
"CLUSTER_ENDPOINT_URL": "https://server-3.ami.com",
"CLUSTER_BALANCER_URL": "https://server-3.ami.com"
}
},
{
"host": "server-4.ami.com",
"username": "ubuntu",
"pem": "./ssh.pem",
"env": {
"CLUSTER_ENDPOINT_URL": "https://server-4.ami.com",
"CLUSTER_BALANCER_URL": "https://server-4.ami.com"
}
},
}
MONGO_URL is one of the environment variables in Meteor, which is used for connecting to Mongo in the production environment. To add MONGO_URL, I run the following command:
{
“MONGO_URL" : "mongodb://lumin:[email protected]:27017, 54.174.9.185:27017, 54.174.9.186:27017, 54.174.9.187:27017/Ami?replicaSet=Ami"
}
Oplog or operation log is a special collection that records all the write operations as they are applied to the database (you can find more helpful information at https://github.com/meteor/docs/blob/version-NEXT/long-form/oplog-observe-driver.md)
The command used to enable Oplog is as followed:
{ MONGO_OPLOG_URL: ‘mongodb://lumin:[email protected]:27017, 54.174.9.185:27017, 54.174.9.186:27017, 54.174.9.187:27017/ local?authSource=admin
}
Are you done all of these above steps? Let’s move to deploy our app. Firstly, I go to the settings folder of the app.
> mup setup
> mup deploy
So far, I have deployed my app successfully. MUP also supports other useful commands to maintain your production app. After you’ve edited the environmental variables of settings.json, you can reconfigure the app without deploying again:
> mup reconfig
Check out other useful commands:
> mup stop # stop all servers
> mup start # start all servers
> mup restart # stop all running servers and start it again
Congratulation! Your Meteor app is now ready to dance to your tune. Keep an eye out for our further blog on Meteor tutorials and you will find out more helpful information. I would love to know whether you deploy your app successfully or not in the comments below.