MeteorJS on Amazon Lightsail03 Apr 2017
Learning meteorjs can be overwhelming at first. Especially once you decide to host your applications, well, anywhere! According to the official meteorjs documentation, amazon aws is way too plebeian and you should obviously be using their overly expensive, in-home service: Galaxy!
Galaxy costs a staggering $30.00 USD/mo (not including the costs of staging a separate mongodb). Enter Amazon Lightsail! The server specs are limited but it will work well for small applications and it only costs $5.00/mo (including mongo!) Allow me to reveal the magic and demonstrate just how easy it is to host your meteor project! We’ll be using nginx, because I always have trouble binding anything to port 80 without some kind of wrapper. Plus I like the flexibility nginx gives.
Amazon Lightsail can be quickly setup. Go checkout their landing page and get the configuration pre-loaded with nginx. Amazon lightsail offers a nifty browser-based ssh tool. So let’s go ahead and use that to install some necessary packages.
Next we need to configure nginx.
Let’s add a tried and true nginx proxy so meteor can be happy and nginx can be happy. Remove everything in location and make it look similar to this:
You will have to reload the nginx configuration for the changes to take effect.
Your system is now setup. Back home, on your dev machine, you can generate a nodejs meteor “package” with this simple command. The output will contain a .tar.gz file.
And once you have that tar.gz file, scp it up to your lightsail box. Here’s a little upgrade script I wrote which will extract the .tar.gz and set everything up according to the meteor README.
For my own project, I wrapped that latter part in an ubuntu service. But even without it… here’s a $5.00 meteorjs server!
Boom! mic drop