DEV Community

Cover image for Install Node.js on Ubuntu 20.04
SittingDev
SittingDev

Posted on • Originally published at sittingdev.com

4 2

Install Node.js on Ubuntu 20.04

Learn how to install Node.js and NPM on Ubuntu 20.04 LTS with this quick tutorial.

Find the latest version of Node.js through the apt repository.

sudo apt-cache show nodejs

The apt repository version is often outdated compared to the latest long-term support version available on the Node.js website. So we will install it from there instead.

Go to the Node.js website - https://nodejs.org/en/.

Click on the 'other downloads' link and navigate to 'install node.js via package manager'.

Go to this URL - https://github.com/nodesource/distributions/blob/master/README.md.

Scroll down until you find the LTS version of Node.js and proceed to the next step.

To install Node.js you will need to make sure you have curl installed.

curl --version

If you need to install curl -

sudo apt install curl

Now go back to the github page we opened and proceed to follow the instructions.

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

Once this has run, you will want to check the version to confirm that node has installed as it should.

node --version

You can also check the NPM version as it was installed with Node in this case.

npm --version

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started