What does your Meteor hosting setup look like?

Hey guys!

I thought it would be awesome if we could look at the current state of things when it comes to hosting Meteor apps, and get some more insight into the process. Based on any information I collect in this thread, I plan on doing a write-up examining the current state of deployments for Meteor, and your help is greatly appreciated in making this possible!

We’ve got Galaxy, which is the easiest solution that one can go for to get started. Heroku is also a brilliant solution, and works surprisingly well for Meteor apps, with the Horse buildpack. There’s obviously Mup (Meteor Up), which seems to have recently gone a maintainer change, so waiting to see how it turns out moving forward. Mup is more complicated to set up than both Galaxy or Meteor, but it also offers much more flexibility in return.

There’s a big list of PaaS providers that can work with Meteor, but I’m more interested in hearing about the custom deployments.

All of you who’ve gone the custom route:

  • What process manager are you using? PM2, Phusion, etc.
  • Do you use NGINX? If yes, what does your config look like?
  • What host did you go with, and why?
  • Where do you host your database? mLab, Compose, self-hosted, etc.
  • How do you implement scaling, in terms of scaling up-and-down to handle load?

Answers to these questions would be really helpful for competing the write-up, and I’m looking forward to hearing how all of you here use Meteor in production! Cheers!

I’m using meteor-up for process management and deploying the app. For setups with one app per server, that is all I do, and when I need to set up multiple apps per box, I use Nginx with proxy passing. The setup is simple:

/etc/nginx/conf.d/meteor.conf

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

/etc/nginx/sites-enabled/APP_NAME

server {
    listen 80;
    server_name APP_DOMAIN;

    location / {
        proxy_pass       http://127.0.0.1:PORT/;
        proxy_set_header Host $host;
        proxy_http_version      1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

Of course for each app you need a separate file in the sites-enabled directory and each has to have a different PORT value. I like to use 8000, 8001 and so on. The port is also configured in the mup.json file so meteor-up knows which one to use. As for hosting, I’m currently using DigitalOcean ($5 droplets are fine for hosting one small app with its db and $20 can host you a few of them) and self-host my databases. The apps I develop are usually used in-house so I don’t really need to implement any scaling measures, which makes the whole thing much easier :slight_smile:.

I deploy to single, self-contained VPS droplets on iwstack in the Netherlands zone.
Some are $3,- hosts ( 1vCPU, 768MB 10GB SSD ), some are $5,- hosts ( 2vCPU 1.5GB 10GB SSD). Over a year now, no downtime.

These are all low-impact apps ( <100 simultaneous users).

  • Ubuntu 16.04
  • Nginx with Letsencrypt SSL
  • All HTTP traffic is rerouted to HTTPS over HTTP/2 in nginx
  • mongoDB is self-hosted on the same server, but standalone, not the meteor build-in one.
  • crontab scripts for backing up the db onsite and offsite 2x a day.
  • PM2 for process management, and PM2-meteor for deployment.

If you tune your app well( correct indexing of your queries, no overfetching of data, limiting your reactive subscriptions, … ), you can get a lot of mileage from a single instance. I have a $3,- droplet running 2 meteor apps, 2 graphQL servers as a backend to 2 react-native apps, and it doubles as a FCM cloud messaging gateway. That, and running the mongoDB daemon and nginx, and it’s purring along nicely.

Same as @M4v3R no real need for scaling for me.

Thanks @eleventy and @M4v3R for the responses! Very interesting to see your approaches :).

Let’s keep the replies coming!

For my pet projects I created my own Docker-based deployment process. Basically if I git push to the release branch, some magic happens, and the webapp just pops up on my server. Pretty comfortable.

I use a standard Ubuntu VPS, have nginx sitting on port 80. I run two Docker containers since it’s a 2 CPU config, and Meteor/Node.js uses only one of them. Nginx distributes the load between those. Based on the load I had this far, it can handle about a few thousand simultaneous users on a $12 VPS.

Mongo is also local, since it’s not a mission critial system. The entire mongodump is backed up to BackBlaze every hour.

The host is Aruba since I wanted something cheap.