Install NodeJS
Debian 12 Instructions
The script below has been tested on Debian 12, and will install Node 18 and now 20. You can simply change the NODE_MAJOR
variable if you wish
to install a different version of Node, such as Node 22.
Original (Outdated) Instructions
Below are the original instructions I used to give, which are now outdated and will not work in the future.
Below are the instructions to install nodejs on a debian based distribution such as Ubuntu.
Ubuntu 18.04 - Native Packages
18.x LTS
Running the webserver
Add the bin
folder to your path, then simply execute:
This will run node on a single thread. If you have multiple vCPUs then you may wish to run Nginx or Apache as the HTTP handler which calls node.
References
- Github - NodeSource Node.js Binary Distributions
- nodejs website
- nodejs website - Installing Node.js via package manager
First published: 16th August 2018