Amazon EC2 provides a free tier program for you to experiment and create your own projects. Recently I wanted to install NodeJS in Amazon EC2 with Ubuntu 14.04 as the operating system of the server. I was surprised to find that there was no article with instructions on how to install NodeJS version 4 so I thought I’d write a tutorial that explains how to do this with package manager in Ubuntu 14.04.
- Login to your AWS Console
- Select EC2 under servicesEC2
- Click on Launch InstanceLaunch Instance
- Select Ubuntu 14.04
- Click on Edit Security Groups and add HTTP on port 80 and HTTPS on port 443Security Group
- Download your key pairing
- Once it is running right click and select Connect
- To access your instance:
- Open an SSH client. (find out how to connect using PuTTY)
- Locate your private key file (MandarinTreehouse.pem). The wizard automatically detects the key you used to launch the instance.
- Your key must not be publicly viewable for SSH to work.
- Connect to your instance using its Public DNS
- If you’re connecting using PUTTY you can find more information here on Amazon’s AWS documentation on how to connect via the key pair that you downloaded when creating the instance. You will need to use PuttyGen to convert the key pairing that you downloaded in step 6 into the format that Putty understands.
- To install NodeJS version 4 you will need to run the following command in the terminal
wget -qO- https://deb.nodesource.com/setup_4.x | sudo bash -and then:
sudo apt-get install --yes nodejs
- To verify that node is installed corrected run
You just created an Amazon EC2 instance that had Ubuntu 14.04 installed as the operating system. You installed version 4 of NodeJS by using the version 4 source instead of the default 0.10 source in Ubuntu 14.04’s package manager. It wasn’t too bad was it? Please feel free to leave a comment, some feedback or ask a question below!