Nội dung
In this article, AZDIGI will show you how to install Node.js on Ubuntu 20.04.
I. Introduction
Node.js is a JavaScript runner for server-side programming. It allows developers to create extensible backend functionality using JavaScript, a language many people are familiar with in browser-based web development.
II. Performance conditions
This tutorial is done on Ubuntu version 20.04. Before you begin, you should have a user account with sudo privileges set up on your system, or if not, you can use the root account.
III. Install Node.js on Ubuntu 20.04
To install Node.js on Ubuntu 20.04, we follow these 2 steps.
Step 1: SSH into your Ubuntu 20.04 system
To install Node.js on Ubuntu 20.04, we first need to SSH or access your VPS/server as root. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH as root, we continue with step 2 to execute the Node.js installation commands.
Step 2: Commands to install Node.js on Ubuntu 20.04
First, you should update your Ubuntu with the following command:
apt update
After the update is complete, use the following command to install Node.js from the default Ubuntu repositories. At the time of writing, the version in the Ubuntu repositories is Node.js 10.19
.
While this is not the latest version of Node.js, it is a stable version with all the features you need.
apt install nodejs
After running the above command, you will get information about how much space to download and how much space it will take up after installation. You need to enter Y
to continue the installation process.
After the installation is complete, use the following command to check if you have successfully installed or not and, if it has been successfully installed, what version has been installed.
nodejs -v
Below is an image of my Node.js installation log on Ubuntu 20.04 and checking the Node.js version I just installed.
If the package in the repository suits your needs, this is all you need to do to set up Node.js. However, in most cases, you’ll also want to install the Node.js package manager npm
. You can do this by installing npm
with the apt command below:
apt install npm
This will allow you to install modules and packages for use with Node.js.
At this point, you have successfully installed Node.js on your Ubuntu 20.04 server.
IV. Summary
So AZDIGI has completed the steps to install Node.js on Ubuntu 20.04 server.
Wishing you success!
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com .