Hello, can you help by suggesting economical options for hosting my Meteor app and database?
I am new to deploying Meteor apps. What I am finding is a standard linux shared server will not work for Meteor apps, is that correct? When I have developed php and python applications I have simply used a linux shared server that costs US$10 a month to host and I used free open source databases that reside on the same server.
Current setup:
I currently have a prototype of my Meteor app hosted on Meteorās Galaxy āserverā. Current monthly costs are US$15/month (with only one visitor - myself - using the app).
From what I understand I cannot create/host a Mongodb database on Galaxy right?
So I have a mongodb database hosted with ScaleGrid (I have one month free)
What Iād love to know is options/hosts where I can host my Meteor app economically and desirably keep my Mongodb database on that same host for free. Does such a thing exist?
AWS is probably one of the cheapest options, you can get burstable t3 instances for < $5 per month, you could host both meteor and mongo on the same machine if you donāt need high availability, redundency or performance
It depends on your usage. A t3.nano costs $3.744 per month in us-west-2 region, in addition to that youāll need an EBS hard disk, the size of this will be based primarily on how much data you use, but you need about 10GB with no data at all (OS, meteor, mongo binaries, etc). and it is 10c per GB per month - so right there youāre looking at another $1
You do get 1 year free (of upto 720 t2.micro hours per month), as well as 1 year free on a bunch of other services, though Iām not sure EBS is one of them.
Regarding user spikes - you get what you pay for, wherever you go. You take a cheap hosting option, youāre gonna get cheap servers. AWS burstable instances (t2ās and t3ās) are nice, because you get a guaranteed baseline CPU usage (itās tiny, like 5% on the nanos) but you can burst to 100% based on the credits youāve accumulated (how long the server has been running), you can also enable a flag called āunlimitedā which will allow you to burst even if you run out of your credits - at which point you pay per credit, so its a nice failsafe. The downside is they have really low RAM
Itās relatively easy - Iād say comparable with setting it up on any other server, unless youāre talking about a dedicated service (e.g., galaxy).
We use AWS - weāre running 4 apps, with multiple load balanced servers each, and 3 mongo deployments
If you are looking for free database, I would recommend using MongoDB Atlas. Iām using it for staging for my app and it is doable. It is easy then to quickly scale, though once you get there it is on par with costs of Galaxy, on the other hand, the profit goes to the creators of MongoDB which helps support further development.
I think it all depends on your app requirement. I think for small meteor app a USD 5 Digital Ocean(DO) box is enough for everything ā including Mongodb. which can be moved to USD 10 DO box as your app grows. The thing I like about DO is its simple pricing.
I have a side project with a handful of concurrent users. Itās using Nginx, PM2, 2 Meteor instances and MongoDB on one machine with 2GB RAM, 50GB disk and 2 CPUs. Itās an older Scaleway dot com plan for one virtual machine. It means you have to take care yourself of installing the software you need, security hardening, backups and monitoring. So far itās running 9 month without downtime, response times for methods and publications are usually around 100ms and it costs EUR 3.99 per month.
I agree with @znewsham AWS has been working really well for me. A T3.nano or micro are fine to run smaller apps. I have a T3.micro running a customer facing site and mongo db that is used by several people daily with no issues, I store all my images on s3 its also really cheap and keeps the server load down.
Who ever told you that hasnāt done much research - because this is what Iām doing.
I advise you to take a look at http://meteor-up.com/. Meteor-up (or mup) allows you to use any machine you want - as long as you have SSH access and can run docker on it to host your meteor project. Itās pretty robust, easy for getting started and Iāve used it for quite a while.
What it does is pretty simple:
It runs meteor deploy in your application folder and creates a zip file of the compiled project
It connects to the server and uploads this zip file, unzips this file and spins up a docker container which adds this data into the container and builds the native packages
While building your new version it keeps the old docker container around. In case the deployment fails it will start the previous version again.
When planning to run multiple small apps on one server I would use mup to deploy the apps and set up an nginx as proxy which will route the requests to the individual application. Let your one app run on port 3000, the next on 3100 and let nginx take the navigation to route all requests on port 80 for example1.com to the first and all requests on port 80 for example2.com to the other - I think you get the trick.
mup was not suited for me in the long run because it uploads the application as zip-file and downloads all the native packages when building the container. When you have an application running on multiple servers, this has to be done on each server - which is why I switched to creating a complete docker-image containing the application which is ready to run. Now I can just build this image, upload it to docker-hub and whenever I want to update the app on the server I can simply exchange the image. It saves you time when you have your app running on multiple servers. And it might also help you debugging it because you can just run the container locally. This is a bit more complicated if you ever should encounter a deployment error in mup - gladly Iāve been spared of those.
Everyone else has already talked about pricing, so Iāll spare you of that. Just as a short summary, I run my application on Azure VMs and use Atlas for the database.