Install NodeJS 18 on Ubuntu 22.04

Learn how to install NodeJS 18 on Ubuntu 22.04 in this quick tutorial.

Install NodeJS 18 on Ubuntu 22.04

At the time of writing, NodeJS 18  and Ubuntu 22.04 are the LTS versions of each respectively. You will be guided through installing NodeJS 18 on Ubuntu 22.04 in this tutorial.

Other articles in this series:

Step 1 - Add NodeSource PPA

ENter the following command which will add the PPA sources for NodeJS 18 on your Ubuntu 22.04 installation:

curl -s https://deb.nodesource.com/setup_18.x | sudo bash

Once installation is complete, the console should output the results to the console.

Installation process of NodeJS 18 on Ubuntu 22.04
Install NodeJS 18 LTS on Ubuntu 22.04 LTS

Step 2 - Install NodeJS 18

In the previous step, we added the PPA source. This allows the APT package manager to install NodeJS 18 on our Ubuntu 22.04 installation. Run the following command:

sudo apt install nodejs -y
Tip: The -y flag means we're not prompted to confirm our choices

Step 3 - Confirm the installed version of NodeJS

Finally, let's check to see the version of NodeJS installed is 18.x as expected. Run the following command:

node -v

We should see an output that confirms the version of NodeJS being 18.x on our Ubuntu 22.04 installation.

Installation confirmation of NestJS 18 on Ubuntu 22.04
NodeJS 18 successfully installed on Ubuntu 22.04

As always, feel free to provide feedback in the comments and feel free to ask any questions.