In this tutorial, we will see how to install node.js (a JavaScript runtime environment) on our Linux server (Debian / Ubuntu / CentOS).It is essential for many uses, including the pterodactyl panel.

Preparation of the system

If you already have a version of Node.js we will delete it.

On Debian & Ubuntu

sudo apt remove --purge nodejs npm
sudo apt clean
sudo apt autoclean
sudo apt install -f
sudo apt autoremove

Installation of Node.js

Let's now install the latest version of Node.js stable. You can check the list of Node.js versions still maintained here. We will install the 14 version which is in LTS (long term support).

node.js release cycle

Debian & Ubuntu

curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt update && apt install -y nodejs

In CentOS

curl -sL https://rpm.nodesource.com/setup_14.x | bash -
yum install nodejs