• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Deploy a Meteor Application on Ubuntu

How VPS by How VPS
January 1, 2020
in Linux
0
0
SHARES
174
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Multi-core support
  2. Want to contribute?


This article will walk you through deploying your Meteor app to a Vultr VPS running Ubuntu 14.04. It may also work on other Linux distributions (attempt at your own risk).

An ingenious fellow named Arunoda Susiripala, who’s quite active in the Meteor community, has developed a deployment tool called mupx (short for “Meteor Up X”), which makes it extremely easy to deploy your Meteor application to a remote server via ssh. Mupx is the successor to mup. We’ll walk you through the process from start to finish. Mup does most of the heavy lifting, fortunately, so this will be a breeze!

Our first step is to install mupx. You’ll do this on your development workstation, not your VPS server! Make sure you have Node.js already installed, and run:

$ npm install -g mupx

After installation is complete, go into your Meteor project folder, e.g. /projects/myApp, and run the following commands:

$ mkdir .deploy
$ cd $_
$ mupx init

For those not familiar with the $_ syntax, it’s a shortcut for the last argument used in a command. So in this case, cd $_ executes as cd .deploy.

You will see the following output:

Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
Configuration file : mup.json
Settings file      : settings.json

Empty Project Initialized!

The initialization process creates two files, mup.json and settings.json. We’ll leave the latter file alone right now. Go ahead and open up mup.json. At the time of writing this article, the default mup.json looks like this:

{
  // Server authentication info
  "servers": [
    {
      "host": "hostname",
      "username": "root",
      "password": "password",
      // or pem file (ssh based authentication)
      // WARNING: Keys protected by a passphrase are not supported
      //"pem": "~/.ssh/id_rsa"
      // Also, for non-standard ssh port use this
      //"sshOptions": { "port" : 49154 },
      // server specific environment variables
      "env": {}
    }
  ],

  // Install MongoDB on the server. Does not destroy the local MongoDB on future setups
  "setupMongo": true,

  // Application name (no spaces).
  "appName": "meteor",

  // Location of app (local directory). This can reference '~' as the users home directory.
  // i.e., "app": "~/Meteor/my-app",
  // This is the same as the line below.
  "app": "/path/to/the/app",

  // Configure environment
  // ROOT_URL must be set to your correct domain (https or http)
  "env": {
    "PORT": 80,
    "ROOT_URL": "http://myapp.com"
  },

  // Meteor Up checks if the app comes online just after the deployment.
  // Before mup checks that, it will wait for the number of seconds configured below.
  "deployCheckWaitTime": 15,

  // show a progress bar while uploading. 
  // Make it false when you deploy using a CI box.
  "enableUploadProgressBar": true
}

We need to change a few things in order for the setup process to work.

First, make sure to set host to your VPS IP address, for example:

"host": "123.123.123.123",

If you need to use a port number other than the default 22, you can do so using the sshOptions field, for example:

"host": "123.123.123.123",
"sshOptions": { "port": 9876 },

Set the username value to whatever user you want to own your Meteor app’s installation. I recommend removing the password line and using an SSH key instead, for security purposes. Uncomment the line with the pem value and make sure it points to your SSH secret key that corresponds with the SSH public key you’ve installed on your VPS (in /root/.ssh/authorized_keys). Make sure to add a comma after the password line! If your SSH key has a passphrase attached to it, remove the pem line entirely, and make sure that your SSH private key is cached in an ssh agent (e.g. on Mac, ssh-add <path to ssh private key>).

Leave setupMongo set to its default value.

Change appName to the name of your Meteor app. In our case:

"appName": "myApp",

… and set the location of the app as well, relative to this deployment folder:

"app": "..",

Lastly, set the ROOT_URL to the designated URL for your app. Explicitly set a port number to the standard HTTP port.

// Configure environment
"env": {
  "ROOT_URL": "http://myapp.com",
  "PORT": 80
},

That’s it! Save the mup.json file, then run:

$ mupx setup

At this point mupx will ssh into your VPS, install Docker, set the environment up, and pull the appropriate Docker images. Now deploy your app:

$ mupx deploy

Now if you go to http://123.123.123.123, your app will show when the page loads.

Multi-core support

If your VPS has multiple cores, your Meteor app can take advantage of that. We’ll just have to make a couple quick tweaks.

First, you’ll need to install the cluster package. Go into the folder of your Meteor app (in this example, /projects/myApp), and type:

$ meteor add meteorhacks:cluster

Now edit your mup.json file and modify the environment variable section like so:

// Configure environment
"env": {
  "ROOT_URL": "http://myapp.com",
  "PORT": 80,
  "CLUSTER_WORKERS_COUNT": "auto"
},

Since we’ve added a new package to your app, you’ll have to redeploy.

$ mupx setup && mupx deploy

If you ever want to change your environment variables in mup.json without having to deploy the whole app, simply use the reconfigure command. This is useful when there were no application changes made.

$ mupx reconfig

Congratulations, your Meteor app is now up and running! Also, your app will automatically start whenever your VPS reboots. Keep an eye out for future articles on Meteor deployment and management.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Ajenti and Ajenti V on Ubuntu 14.04 and 16.04

Next Post

Installing Node.js and Express on Ubuntu

Next Post

Installing Node.js and Express on Ubuntu

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet