is a service that helps you model, setup and replicate your AWS resources. It uses a file to bring up a collection of resources together as single stack. AWS CloudFormation template To create templates we use a or . For this tutorial I opted the first solution. JSON file AWS CloudFormation Designer Note: The template is available on my Github . We start with a basic template that defines a single with a that on port , traffic on port , and the app on port from , as shown below: EC2 instance security group allows SSH traffic 22 MongoDB 27017 NodeJS 3000 anywhere In addition to that, we create two input parameters that specify the and a for . Then, we use _UserData_property to provide a set of shell commands to install , and bootstrap a simple application. Finally the output section print the public URL of the application. instance type Key Pair SSH access MongoDB NodeJS MEAN MEAN Now we defined our template. Go to then navigate to and click on “ “: AWS Management Console CloudFormation Dashboard Create Stack Upload the JSON file and click on “ “: Next Assign a name to the stack, and choose your instance type and key pair you will use to ssh to the instance. Then, click on “ “: Next Left all fields unchanged and click on “ “, then “ “ Next Create Once launched, you will get the following screen with launching process events: After a while, you will get the CREATE_COMPLETE message in the status tab. If you point your browser to the shown in the tab, you should see: a simple HTML message: URL Outputs If we change the endpoint we should see a JSON response: Congratulation ! you have deployed your . MEAN Stack application Go to , you should see your instance there: EC2 Dashboard Verify the is setup as configured in the template: security group To verify all packages and dependencies has been installed correctly, we can connect to the server via SSH: To terminate the instance we can delete the stack from the , Deleting the stack will terminate all the instances launched by the stack: CloudFormation Wizard