Deploy Maka-CLI Apps to AWS using Meteor, Nginx, PM2, and NVM.

$ maka aws

Prepare: AWS Tokens and AWS-CLI

Before we start on our project, you’ll need to install AWS-CLI and configure it with your AWS Token and Secret. It’s pretty straight forward, here’s some steps to help you out:

  1. Download the aws-cli python application:
pip install awscli
This ID and key don’t exist anymore…so don’t try it :D
Just fill in the prompts. For your region, figure that out… mine is us-east-1.

Your Project

First, setup a bare maka project. If you aren’t familiar, head on over to my intro articles and see what I’m talking about.

$ maka create aws-app
$ maka aws:create-key-pair --env dev
Just say “yes” in order to map the path of the pem in your ssh.json file.
$ maka aws:create-sg
$ maka aws:create-instance --env dev
Seriously though, just leave it as the default for THIS example.
I know, I need to make the image ids more meaningful… I’m getting to it!
$ maka aws:set-host --env dev
$ maka deploy ubuntu --env dev --mongo

DONE!

For real?! Yup. Head on over the IP address that finalized the deployment and you’ll see that the app is happily running. You’ll also see that there is nothing impressive on this EC2 instance worth keeping around. So, instead of paying hard earned pennies for it. Lets terminate it.

$ maka aws:terminate-instance

RECAP!

So, there you are. You have created a full fledged web application running on NodeJS, with a React front-end, and deployed it to a cloud-based environment using Maka-CLI and AWS-CLI. This instance, has a full mongo server, process manager and application load balancer (PM2), and reverse proxy (Nginx) running which takes FAR less resources (and has working network interfaces) and a lot less storage space requirements than a configuration with Docker.

Parting Words

You can manage your next instance (or this one, if you haven’t yet terminated it) with the integrated SSH command:

$ maka ssh --env dev

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store