How to Install Node.js on Ubuntu 16.04

r00t August 17, 2017

Install Node.js on Ubuntu 16.04

In this tutorial we’ll learn how to install Node.js on Ubuntu 16.04. We will also install and configure its prerequisites. Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Many of Node.ja modules are written in JavaScript, which simplifies development of applications using Node.js. Node.js nothing but a combination of the Runtime environment and JavaScript modules.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 16.04 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Node.js on Ubuntu 16.04

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y
apt-get install -y build-essential

Step 2. Installing Node.js.

If you just want to get Node.js installed on Ubuntu (specifically Xenial Xerus distributions), and don’t need anything else other than the quick how, here are the two commands you need to run:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

Run the following command to make sure that you install the latest version of Node.js:

apt-get install -y nodejs

Once this install is run to completion, should have been successfully installed on the system.

Step 3. Verify Node.js Installation.

Check the version of Node.js using the following command:

$ nodejs -v
v6.5.0

$ npm -v
3.10.3

Congratulation’s! You have successfully configured Node.js on your Ubuntu 16.04 LTS server.

Save

Save

The Tags:

Leave a Comment

Comments are closed.