Community Blog How to Install Node.js on Ubuntu 16.04

How to Install Node.js on Ubuntu 16.04

Node.js is excellent for web application, and in this tutorial, we will introduce how to install Node.js on Ubuntu 16.04.

Node.js is an open-source cross-platform environment for JavaScript that allows you to run JS code outside the browser. Node.js also allows you to run scripts on server side for producing dynamic webpages. Rather than using different server side and client-side languages, by using Node.js alone, you can unify your web application around a single programming language - adding a whole lot of convenience to your workload.

In this tutorial, we will introduce how to install Node.js on Alibaba Cloud ECS instance with Ubuntu 16.04.

First, you need to set up your environment.

  1. Setting up your server
  2. Installing software-properties-common
  3. Installing apt-transport-https
  4. Installing ca-certificates
  5. Installing Curl
  6. Installing Docker CE
  7. Installing Docker Compose

Then, you can run the following command which will pull latest Nodejs from official docker repository.

# docker pull linode/server-node-js

Next, run the following command to run docker image.

# docker run -d -p 80:3000 linode/server-node-js

After it is completed, you can verify it by accessing your Alibaba Cloud ECS IP address or domain name pointing to that IP address, like http://your_domain.tld/test.htm. If the test page showed up successfully, then Node.js is successfully installed on your Ubuntu 16.04 instance.

For details for setting up your environment, please go to Install Node.js on Alibaba Cloud.

Related Blog Posts

Running Your Node.js Application on ECS with Systemd or Forever

We need our Node.js application to be always running no matter what happens as an unexpected crash, an exception, a bug, IO failure or any other reason.

For this article, we've chosen to run/manage our application either with systemd, or with the famous forever tool which will be first detailed in the next lines or even make a merge and do both of them work in sync at the same time. We will be testing both methods on an Alibaba Cloud Elastic Compute Service (ECS) instance.

How to Install and Set Up Monica

Monica is an easy-to-use, open source web based personal management system. In this tutorial, we will be installing and setting up Monica using Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

Monica requires 10.x version of Node.JS. To install it, add the source and then install Node.JS. To do so, execute the following commands.

# curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
# sudo apt-get install nodejs

To verify successful installation of node and node package manager, run the following command.

# node -v && npm -v

Related Documentation

Use Node.js SDK

The Alibaba Cloud Node.js Software Development Kit (SDK) allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.

This document introduces how to obtain and call Alibaba Cloud Node.js SDK.

Introduction to ApsaraDB for Memcache SDK for NodeJS

Alibaba Cloud SDK for NodeJS is a unified entry for NodeJS developers to use various Alibaba Cloud services. This SDK is developed and maintained by the Alibaba Cloud UED team. Currently, this SDK integrates three Alibaba Cloud services: ApsaraDB for Memcache, OSS, and RDS (MySQL).

0 0 0
Share on

Alibaba Clouder

2,600 posts | 754 followers

You may also like