Install NodeJS in Amazon EC2 with Ubuntu 14.04
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 services
- Click on Launch Instance
- Select Ubuntu 14.04
- Click on Edit Security Groups and add HTTP on port 80 and HTTPS on port 443
- 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!
Jon Jones lived in Eagle, a small remote village twenty miles from Lakeside the nearest city. Jon was perusing Eagle’s Eye, the morning newspaper while eating his bacon and eggs breakfast when the telephone rang. Jon wasn’t too keen about being interrupted in the middle of his morning routine. But, he thought to himself, “Duty calls”. After the third ring he picked up the phone. Jon answered and said, “Hello, Mr. Jones speaking. How may I help you?”
“This is Robert Willams down in Lakeside and I need your assistance with several matters that have been troubling me,” said the businessman. He continued, “I would like you to come visit me at my mansion at 1347 Remington Lane.” Jon thought he remembered the name. Then he knew why. Robert was one of the richest men in Lakeside. He owned an hundred acre ranch in the countryside and his company, ‘Three Pillars Ltd.’ was the leading manufacterer of computer technology in the country. Jon told the man, “I’ll be over there as soon as possible,” and then hung up the phone.
Jon quickly grabbed his keys and dashed out the door that lead to his garage where his four wheel drive Honda CRV was parked. He got in, slammed the door and openned the garage. Backing out as fast as he could he headed toward 1347 Remington Lane.
“Mr. Jones, thanks for coming on such short notice,” said Robert Williams.
“Anytime, anytime. So how may I be of assitance?” Replied the detective.
“A few weeks ago I received a mysterious memo from an unknown slender. The memo did not come by the regular mail it was given directly to one of my maids in person. When I returned from my day’s work my maid delivered the note. I have it with me.” Pulling the letter out he read, “There’s nothing like digits of the metal that drives a man insane”. Shortly after reading the note the telephone rang and I picked it up but when I got to the phone I heard the person on the other line hang up. I’m afraid I cannot figure out the meaning of these events and that’s why I’ve requested your assitance.”
“May I have a glance at the memo,” inquired Jon and Robert nodded handing the memo over.
After a brief moment Mr. Jones handed the memo over and said, “Can you take me to the phone that you have mentioned? I would like to have a glance.”
Persistence and determination alone are omnipotent. The slogan “press on” has solved and always will solve the problems of the human race.
CALVIN COOLIDGE Thirtieth president of the United States
“For we wrestle not against flesh and blood, but against principalities, against powers, against the rulers of the darkness of this world, against spiritual wickedness in high places.
“Wherefore take unto you the whole armour of God, that ye may be able to withstand in the evil day” (Eph. 6:10–13).
All our life, so far as it has definite form, is but a mass of habits,” William James wrote in 1892.prl.2 Most of the choices we make each day may feel like the products of well-considered decision making, but they’re not. They’re habits. And though each habit means relatively little on its own, over time, the meals we order, what we say to our kids each night, whether we save or spend, how often we exercise, and the way we organize our thoughts and work routines have enormous impacts on our health, productivity, financial security, and happiness. One paper published by a Duke University researcher in 2006 found that more than 40 percent of the actions people performed each day weren’t actual decisions, but habits.
The Power of Habits by Charles Duhigg
Excellence is an art won by training and habituation: we do not act rightly because we have virtue or excellence, but we rather have these because we have acted rightly; ‘these virtues are formed in man by his doing the actions’; we are what we repeatedly do. Excellence, then, is not an act but a habit: ‘the good of man is a working of the soul in the way of excellence in a complete life… for as it is not one swallow or one fine day that makes a spring, so it is not one day or a short time that makes a man blessed and happy’.
Will Durant, The Story of Philosophy: The Lives and Opinions of the World’s Greatest Philosophers
“Don’t wish it were easier wish you were better. Don’t wish for less problems wish for more skills. Don’t wish for less challenges wish for more wisdom”
Jim Rohn The Art of Exceptional Living
The development environment that I will use to build an Ionic Mobile application includes the following items:
- Visual Studio Community 2015. This is a great way to get the benefits of this IDE without having to pay the premiums. Visual Studio is a robust IDE and with this community edition you can install extensions.
- ASP.NET Web API. With my background in C# and ASP.NET choosing this as the back-end REST API makes sense. I will be able to write the REST API fairly quickly. The next post will be on building the back-end REST API using ASP.NET Web API.
- Ionic Framework. Also with my background in using this framework at work, I will be able to develop a mobile application in a short amount of time.
- Twitter Bootstrap. I’ve used Twitter Bootstrap before for another project and enjoyed using it. It’s simple and easy to use.
- RedHat OpenShift Online. This is a relatively new service been around for a several years and the free version allows you to create up to 3 “gears” or applications. Since I’m currently getting started on my personal project it makes sense to use this service for now.
- MongoLab. This database service provides a free plan of 500 MB. This will be plenty for my current needs.
Overall, this setup will get me started. Eventually I would want to try building a back-end with Node.js and Express. But for now this setup meets the requirements for my personal projects. The next post will be about building my ASP.NET Web API back-end.