How to install Node.js on Ubuntu 20.04
II. Performance conditions
This tutorial simulates that you are using Ubuntu version 20.04. Before you begin, you should have a user account with sudo privileges set up on your system, or if you don’t have one, you can also use the root account.
III. Install Node.js on Ubuntu 20.04
To install Node.js on Ubuntu 20.04 we need to do the following 2 steps.
Step 1: SSH into your Ubuntu 20.04 system
To install Node.js on Ubuntu 20.04, first we need to SSH or access your VPS or server with root privileges first. If you do not know how to SSH into your VPS or Server .
After successfully SSHing 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
You should first update your Ubuntu with the following command first.
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
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 will need to fill in
Yto 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.
Below is a log image of my Node.js installation on Ubuntu 20.04 as well as 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. In most cases, you’ll also want to install
npmthe Node.js package manager as well. You can do this by installing
npmwith 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.