How to install the latest version of Node.js 8 on Ubuntu 18.04 LTS

Right on schedule, Canonical has released the latest long term service release
of Ubuntu, version 18.04.

This particular release is shipping with Node.js 8 which is the current long
term service release of Node.js. Unfortunately, the version which shipped
(8.10.0) is already a bit behind the latest version, 8.11.1 (at the time of this
writing)

Never fear though, you can easily upgrade to the latest and greatest with a
couple of commands. First, let’s make sure we have curl installed:

sudo apt install curl

Once that’s done, download and run the Node.js 8.x installer:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

The installer will create a source file for the official repo, pulls down the
signing key and even does you a solid by running an apt update for you.

All that’s left to do is to install (or upgrade to) the latest version of
Node.js 8.x:

sudo apt install nodejs

As a bonus, npm will be installed as well.

Now you’re good to go with the latest Node.js 8.x on Ubuntu 18.04 LTS!

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.


If you found this article helpful, please consider buying me a coffee.