How to Install Node.js on Debian 13

How to Install Node.js on Debian 13

Node.js is a versatile, open-source JavaScript runtime environment built on Chrome’s V8 engine. It is designed to develop high-performance, scalable network applications. Whether you’re creating real-time communication tools, building APIs, or powering dynamic websites, Node.js offers complete control over your application’s logic and performance. In this tutorial, we’ll walk you through how to install Node.js on Debian 13.

Prerequisites:

Step 1. Update System Packages

To start, log in to your Debian 13 VPS using SSH:

ssh root@IP_Address -p Port_number

Replace ‘IP_Address’ and ‘Port_number’ with your server’s IP address and SSH port number. If needed, replace ‘root’ with the username of your sudo account.

Once logged in, you must make sure that all Debian OS packages installed on the server are up to date. You can do this by running the following commands:

apt update -y && apt upgrade -y

Method 1: Install Node.js from Debian Repository:

The simplest and most straightforward way to install Node.js and npm is through Debian’s default package repository. However, this method usually provides an older version of Node.js.

Using the following command to install Node.js from the official Debian 13 repository will install Node.js v20.19.0, as available at the time of writing this article:

apt install nodejs

Once the package is installed, verify the Node.js version using the following command:

# node -v
v20.19.0

Method 2: Install Node.js using Fast Node Manager

You can use this method to install a different version of Node.js than the one available in the Debian repositories. Fast Node Manager (fnm) maintains an APT repository that accesses multiple Node.js versions.

In this guide, we will install the latest LTS version, v22.

First, install curl using the following command:

apt install curl

Download and run the Fast Node Manager installation script by running the following command:

curl -o- https://fnm.vercel.app/install | bash

Next, install Node.js version 22.14 by running the following command:

fnm install 22

The Node.js package contains both the node and npm binaries. Once installed, verify the installed version of Node.js with the following command:

# node -v
v22.14.0

You can also verify the npm version with the following command:

# npm -v
10.9.2

In this tutorial, you explored two different methods for installing Node.js on a Debian 13 server. If you’re unsure which version of Node.js to install, it’s best to check the application documentation you plan to deploy.

Of course, you don’t have to do any of this if you use one of our Debian Hosting services. In that case, you can simply ask our expert Linux admins to set this up for you. They are available 24×7 and will take care of your request immediately.

If you liked this post on how to install Node.js on Debian 13, please share it with your friends or leave a comment below. Thanks.

Leave a Comment