Install Node.js and npm

With this step-by-step guide you can easily install Node.js and the corresponding package manager npm & check the installation afterwards.


  • A server with Debian or Ubuntu as operating system
  • SSH root access

Node.js and NPM installation

To install Node.js in the desired version on your server, you can find the corresponding command under the following link:

The following section describes the installation of Node.js version 22 and npm in the corresponding version 9.5.1.

All previous Node.js versions and the corresponding versions can be found at:

First download the official Node.js package manager (NodeSource) and then start installing Node.js and the corresponding package manager npm.


curl -fsSL | bash - && apt-get install -y nodejs


curl -fsSL | sudo -E bash - && sudo apt-get install -y nodejs

Node.js and npm should then be successfully installed on your server.

Check installation

You can check the installation of Node.js and the associated package manager npm with the following commands:


node -v


npm -v