Node.js Amazon CloudFormation template

in Development @ July 18, 2012

The following CloudFormation template will allow you to easily launch Amazon EC2 instances running Node.js, without having to install and configure Node on EC2 every single time.

In order to use it, you need to go to your AWS console in the CloudFormation section and do the following:

  1. Click the Create new stack button
  2. In the Stack Name field provide a name, i.e “Nodejs server”.
  3. In the Stack template source choose Upload a template file and browse for the nodejs.template file (download the Node.js EC2 template). Hit continue.
  4. In the next screen I’ve added a few options in the template so that you can customize your EC2 instance. You will need to provide:
    1. Security group name
    2. Name of an existing EC2 KeyPair to enable SSH access
    3. EC2 instance type (e.g. m1.small)
  5. Hit the continue button again to review your template in the final screen.
  6. If you are happy, you can hit continue one final time to activate the template. (Just a reminder – this last action will activate an EC2 instance, which is going to cost you money! )


CloudFormation will now process the template and activate an EC2 instance of your chosen size. You can monitor the progress in the AWS console.

If you’d rather like to install Node.js manually, check out my step-by-step guide of setting up a new Amazon AWS EC2 instance and installing Node.js with NPM.

This is the Node.js Amazon CloudFormation template: