How to Install Latest Node.js 20 on Ubuntu with PPA

Node.js is a platform built on Chrome’s JavaScript runtime to build fast and scalable network applications. The latest version of the Node.js PPA is maintained by its official website.

Add Nodesource PPA

Add the PPA to the Ubuntu system by running the following command.

apt-get install curl

curl -fsSL | bash -


root@vps:~# curl -fsSL | bash -

2024-02-12 14:27:55 - Installing pre-requisites
Hit:1 jammy InRelease
Get:2 jammy-updates InRelease [119 kB]
Get:3 jammy-security InRelease [110 kB]
Get:4 jammy-backports InRelease [109 kB]
Get:5 jammy-updates/main amd64 Packages [1,371 kB]

Install Node.js

Installing the latest version of Node.js is now possible by running the following command,

apt-get install nodejs


root@vps:~# apt-get install nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 64 not upgraded.
Need to get 26.1 MB of archives.
After this operation, 163 MB of additional disk space will be used.
Get:1 nodistro/main amd64 nodejs amd64 20.11.0-1nodesource1 [26.1 MB]
Fetched 26.1 MB in 1s (49.6 MB/s)
Selecting previously unselected package nodejs.
(Reading database ... 72912 files and directories currently installed.)
Preparing to unpack .../nodejs_20.11.0-1nodesource1_amd64.deb ...
Unpacking nodejs (20.11.0-1nodesource1) ...
Setting up nodejs (20.11.0-1nodesource1) ...
Processing triggers for man-db (2.10.2-1) ...

now let's check the version of the Node.js installed,

  node -v


root@vps:~# node -v