How to install and configure Node.js on Debian

Post Reply
User avatar
isscbta
Team Member
Posts: 132
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 16 times
Been thanked: 3 times

Node.js is a server-side programming runtime that utilizes JavaScript. With it, developers can easily create scalable back-end operations by utilizing a language they may already know well from web development in browsers, JavaScript.

In the following steps, we will guide you through the installation process of Node.js on a Debian server that is running the myVesta Hosting Panel.

1. First you should check latest Node.js version on https://github.com/nodesource/distributions
2. Now all you have to do is run these commands in your SSH, as root:

Code: Select all

curl -sL https://deb.nodesource.com/setup_18.x > setup_18.x 
chmod +x setup_18.x
./setup_18.x
apt install -y nodejs build-essential libssl-dev
The version depends on the version you need, as mentioned in step one. Instead of 18.x, insert the desired version number.

The following are some posts related to this topic:

Tags:
mckaygerhard
Posts: 20
Joined: Thu Jun 08, 2023 6:32 pm
Been thanked: 1 time

this can be made per repository too:

Code: Select all

cat > /etc/apt/sources.list.d/nodejs.list << EOF
deb [trusted=yes] https://deb.nodesource.com/node_16.x $(lsb_release -cs) main
deb [trusted=yes] https://deb.nodesource.com/node_18.x $(lsb_release -cs) main
deb [trusted=yes] https://deb.nodesource.com/node_20.x $(lsb_release -cs) main
deb [trusted=yes] https://deb.nodesource.com/node_22.x $(lsb_release -cs) main
EOF

apt-get update
so then to install nodejs 18.17 you can just do:

Code: Select all

apt-get install nodejs=18.17*
Post Reply