How to Install Latest Node.js 20 on Ubuntu 25.04 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 officially.
Add Nodesource PPA
First, add the PPA to your Ubuntu system by running the following commands:
apt install curl ca-certificates gnupg -y
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
Output:
root@vps:~# curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
2025-04-30 15:33:29 - Installing pre-requisites
Hit:1 http://security.ubuntu.com/ubuntu plucky-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu plucky InRelease
Hit:3 https://deb.nodesource.com/node_20.x nodistro InRelease
Hit:4 http://archive.ubuntu.com/ubuntu plucky-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu plucky-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apt-transport-https is already the newest version (3.0.0).
ca-certificates is already the newest version (20241223).
curl is already the newest version (8.12.1-3ubuntu1).
gnupg is already the newest version (2.4.4-2ubuntu23).
Solving dependencies... Done
The following packages were automatically installed and are no longer required:
cloud-init-base eatmydata libeatmydata1 python-babel-localedata
python3-babel python3-jinja2 python3-json-pointer python3-jsonpatch
python3-jsonschema python3-jsonschema-specifications python3-markupsafe
python3-passlib python3-referencing python3-rpds-py
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Hit:1 http://archive.ubuntu.com/ubuntu plucky InRelease
Hit:2 http://archive.ubuntu.com/ubuntu plucky-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu plucky-backports InRelease
Get:4 https://deb.nodesource.com/node_22.x nodistro InRelease [12.1 kB]
Get:5 https://deb.nodesource.com/node_22.x nodistro/main amd64 Packages [5,812 B]
Hit:6 http://security.ubuntu.com/ubuntu plucky-security InRelease
Fetched 18.0 kB in 0s (61.1 kB/s)
Reading package lists... Done
2025-04-30 15:33:36 - Repository configured successfully.
2025-04-30 15:33:36 - To install Node.js, run: apt-get install nodejs -y
2025-04-30 15:33:36 - You can use N|solid Runtime as a node.js alternative
2025-04-30 15:33:36 - To install N|solid Runtime, run: apt-get install nsolid -y
Install Node.js
Now, install the latest version of Node.js by running:
apt install nodejs -y
Output:
root@vps:~# apt install nodejs -y
The following packages were automatically installed and are no longer required:
cloud-init-base python3-jsonpatch
eatmydata python3-jsonschema
libeatmydata1 python3-jsonschema-specifications
python-babel-localedata python3-markupsafe
python3-babel python3-passlib
python3-jinja2 python3-referencing
python3-json-pointer python3-rpds-py
Use 'sudo apt autoremove' to remove them.
Upgrading:
nodejs
Summary:
Upgrading: 1, Installing: 0, Removing: 0, Not Upgrading: 3
Download size: 36.5 MB
Space needed: 25.0 MB / 21.3 GB available
Get:1 https://deb.nodesource.com/node_22.x nodistro/main amd64 nodejs amd64 22.15.0-1nodesource1 [36.5 MB]
Fetched 36.5 MB in 1s (26.7 MB/s)
(Reading database ... 95563 files and directories currently installed.)
Preparing to unpack .../nodejs_22.15.0-1nodesource1_amd64.deb ...
Detected old npm client, removing...
Unpacking nodejs (22.15.0-1nodesource1) over (20.19.1-1nodesource1) ...
Setting up nodejs (22.15.0-1nodesource1) ...
Processing triggers for man-db (2.13.0-1) ...
Verify Node.js Version
After installation, verify the Node.js version:
node -v
Output:
root@vps:~# node -v
v22.15.0
🎉 Done! Node.js 22.15 is successfully installed on Ubuntu 25.04.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS