Meteor Deployment Mup

meteor-deployment

What is Meteor Up?

Meteor Up, often referred to as “mupx” or “mup”, is a third-party open-source tool that can be used to deploy Meteor application to any online server over SSH. It handles some of the essential deployment requirements, but you will still need to do a lot of work to get your load balancing and version updates working smoothly. It’s essentially a way to automate the manual steps of using meteor build and putting that bundle on your server.

You can obtain a server running Ubuntu or Debian from many generic hosting providers and Meteor Up can SSH into your server with the keys you provide in the config. You can also watch this video for a more complete walkthrough on how to do it.

Meteor Up has multiple projects so select what is best for your project:

  1. The mupx branch (best for pre-Meteor 1.4)
  2. The kadirahq/mup fork (best for Meteor 1.4 or higher)

Currently, using Meteor Up with Meteor 1.4 requires kadirahq/mup (still in development) and a special docker image with the correct Node version.

You install meteor-up via npm:

npm install -g mup

Use a terminal to navigate to your Meteor application folder and initialize for mup:

mup init

Now you have two JSON files in your directory:

  1. mup.json: This file is used to define the servers that will be used as deployment targets and to specify what components to install
  2. settings.json: This file is used to define deployment-specific configuration options available in Meteor.settings.

Although you do not have to use settings.json, you must adjust the contents of mup.json to reflect your own server setup. Once you are finish with modifying the mup.json file, you can set up the environment using:

mup setup

This will take care of all the server configurations and installation for you. It will also ensure that all server processes are started upon reboot. It uses 'forever' to restart a node in case it crashes. To deploy our application:

mup deploy

Beside init and deploy, there are also commands for starting and stopping application (start / stop / restart) and a way to access the Node.js logs (logs). When passing the -f option to logs, you can monitor the log file continuously similar to using the 'tail -f' command.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License