Setting up Node.js on Amazon EC2 instance

Have you been planning on setting up Node.js and related dependencies on your EC2 instance but unable to find a all-in-one guide? If so, you have come to the right place.

For this article i am using Amazon AMI EC2 instance running a Fedora Linux. It is a t2.micro instance and has 2Gs of memory. Also, we will be building the node and npm packages from source instead of using binaries.

You will need to have Super User access to your EC2 instance and the rest is just a simple process.

Install build tools

We need to install tools using yum. Run the following from the user home directory:

Modify PATH

We need to add /local/bin to the PATH variable:

Install Node.js

We will build nodejs after fetching from GitHub. Notice that you can checkout a different version:

Install Npm

Just like Node.js, we will install Npm

Test

To make sure everything is working as expected, run the following:

That’s it! I hope this helped.

alexey

alexey

Application developer, movie buff, occasional reader and a huge Manchester United fan.
alexey