---
title: "How do I upgrade my Node.js version?"
url: "https://ploi.io/documentation/server/how-do-i-upgrade-my-nodejs-version"
published: "2021-10-15"
last_updated: "2026-06-15"
---

# How do I upgrade my Node.js version?

Node.js releases move fast and older versions reach end-of-life quickly, so it's a good idea to keep your server on a current LTS release. This guide upgrades the system-wide Node.js version installed through NodeSource.

Start by logging into [SSH](https://ploi.io/documentation/ssh) and [login as the root user](https://ploi.io/documentation/ssh/how-do-i-login-as-root-user).

Run the following commands, replacing **22** with the major version you want (use a current LTS release such as 22 or 24):

```
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs
```

NodeSource replaces any previously installed Node.js version, so this upgrades an existing install in place.

Verify the active version:

```
node -v
```

If you use a process manager such as PM2, restart your apps so they pick up the new Node.js binary.