On Windows, download the LTS Windows Installer (.msi) from nodejs.org, run it with the default options, then open a new Command Prompt and type node -v and npm -v to check. On a Linux server or VPS you have three choices: your distribution’s own package (easy, but often an older Node.js), the NodeSource repository (current versions through apt or dnf) or nvm (per-user, several versions side by side). At the time of writing the LTS release is Node.js 24.21.0, which comes with npm 11.19.0. We installed it all three ways on Linux in Docker and checked the Windows options against the Node.js project’s own installer files.

Which version should you install?
Node.js publishes two kinds of release. LTS (long-term support) lines are the ones to use for anything you run in production. Current gets new features first and becomes the next LTS later. The Node.js release schedule is the source of truth; at the time of writing it looks like this:
| Line | Status | What to do |
|---|---|---|
| Node.js 26 | Current, scheduled to become the next LTS | Fine for testing new features |
| Node.js 24 (Krypton) | LTS | Install this for new projects |
| Node.js 22 (Jod) | Maintenance LTS, security fixes only | Plan an upgrade |
| Node.js 20 and older | End of life | Upgrade: no more security fixes from the Node.js project |
If an application you use says which Node.js version it needs, follow that instead.
Install Node.js on Windows
Node.js 24 supports 64-bit Windows 10 and Windows Server 2016 or later on x64 machines, according to the project’s platform list. Installers are published for x64 and ARM64.
- Go to nodejs.org/en/download, pick the LTS version, Windows and your processor (x64 for most PCs and servers), and download the Windows Installer (
.msi). - Run the file, accept the licence and keep the suggested destination folder. On the Custom Setup screen, keep the defaults: Node.js runtime, npm package manager and Add to PATH. The PATH option is what lets you type
nodein any terminal. - The installer then shows a Tools for Native Modules page. Its checkbox installs Python and the Visual Studio Build Tools, which some npm packages need to compile C or C++ code, and it also installs Chocolatey. Leave it unticked unless a package you use needs compiling; you can add the tools later.
- When the installer finishes, open a new Command Prompt or PowerShell window (existing windows still have the old PATH) and check:
node -v
npm -v
For the 24.21.0 LTS release, the Node.js download page gives the expected answers as v24.21.0 and 11.19.0.
Other ways to install on Windows
- WinGet:
winget install OpenJS.NodeJS.LTSinstalls the LTS package from the Windows Package Manager repository. Microsoft’s WinGet documentation says the tool is available on Windows 10 version 1809 or later, Windows 11 and Windows Server 2025, so on older Windows Server versions use the.msi. - Chocolatey: nodejs.org offers
choco install nodejs --version="24.21.0"once Chocolatey is installed. - Several versions side by side: the nvm tool used on Linux does not run in a normal Windows command prompt. Its README says it can work through WSL, Git Bash or Cygwin, and points to separate Windows alternatives such as nvm-windows, which it does not support itself.
If PowerShell refuses to run npm with a message that running scripts is disabled, the cause is PowerShell’s execution policy: Node.js ships npm.ps1 alongside npm.cmd, and the Restricted policy blocks .ps1 scripts. Either use Command Prompt, or allow local scripts for your own account as described in Microsoft’s about_Execution_Policies:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Install Node.js on a Linux server or VPS
Here is what each method gave us on fresh containers:
| Method | Result | Good for |
|---|---|---|
Ubuntu 26.04.1 LTS, apt install nodejs npm | Node.js 22.22.1, npm 9.2.0 | Quick installs where the version does not matter |
Debian 13, apt install nodejs | Node.js 20.19.2 | Only if your app still needs Node.js 20 |
AlmaLinux 10, dnf install nodejs npm | Node.js 22.23.2, npm 10.9.8 | Quick installs on RHEL-type servers |
| NodeSource repository on Debian 13 | Node.js 24.21.0, npm 11.19.0 | A current LTS for the whole server, updated with apt |
| nvm on Debian 13 | Node.js 24.21.0, npm 11.19.0 | Developers, or apps that need different versions |
Note that Ubuntu packages npm separately, and the version it ships is older than the npm that comes with Node.js itself.
Option 1: NodeSource (one version for the whole server)
NodeSource publishes Node.js packages for Debian, Ubuntu and RHEL-type systems. On Debian or Ubuntu, as root, following the NodeSource instructions:
apt install -y curl ca-certificates
curl -fsSL https://deb.nodesource.com/setup_24.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt install -y nodejs
node -v
The script adds a repository file pointing to https://deb.nodesource.com/node_24.x and printed Repository configured successfully. After that, node -v returned v24.21.0, and later updates arrive with your normal apt upgrade. You can read the script before running it; it is a good habit with any script you download.
Option 2: nvm (per user, several versions)
These are the commands nodejs.org gives for nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 24
node -v
nvm downloaded the official build, reported Checksums matched! and Now using node v24.21.0 (npm v11.19.0). nvm install 26 added the Current line next to it, and nvm use 24 switches back. Keep one thing in mind: nvm installs Node.js inside your home directory, here /root/.nvm/versions/node/v24.21.0/bin/node. Other users and system services do not see it unless you give them that full path.
Test it with a tiny app
const http = require("node:http");
http.createServer((req, res) => {
res.end("Hello from Node.js " + process.version + "\n");
}).listen(3000, "127.0.0.1", () => console.log("Listening on http://127.0.0.1:3000"));
Save it as app.js, run node app.js, and in a second terminal curl http://127.0.0.1:3000/ answered Hello from Node.js v24.21.0. npm init -y followed by npm install express also worked and reported found 0 vulnerabilities, so npm could reach the registry.
On a server, an app started from your terminal stops when you log out. Run it as a service instead (how to run a script as a systemd service) or in a container with Docker Compose, and put a web server such as nginx in front of it for HTTPS. If nginx shows 502 Bad Gateway, the Node.js app behind it is usually not running.
Troubleshooting
- “node” is not recognised on Windows: open a new terminal. If it still fails, run the installer again and make sure Add to PATH is selected.
node: command not foundafter installing nvm: the installer adds nvm to your shell’s startup file, and its own message says to close and reopen your terminal, or load it with\. "$HOME/.nvm/nvm.sh".- A systemd service cannot find node: it does not read your shell setup. Use the full path from
which nodein the service file, or install Node.js system-wide with NodeSource. - Old version after installing: check
which -a nodeon Linux orwhere nodeon Windows; two copies on the PATH is a common cause.
A Node.js app is a program that has to keep running on the server. A KVM VPS gives you full root access to install Node.js any of these ways, run it under systemd and put nginx in front. If you would like the set-up done for you, our engineers are available by the hour.