🇺🇸 Welcome from the USA! We have special plans for you.
View US Hosting Plans →

Install Node.js on Linux VPS

📅 15/06/2026 ⏱ 5 min de lectura
PlatiniumHost

Escrito por

Luis Contreras · CEO & Fundador · +24 años en hosting

Install Node.js on Linux VPS

Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to execute JavaScript code on the server side. It is ideal for building scalable web applications, RESTful APIs, microservices, and command-line tools. Installing Node.js on your Virtual Private Server (VPS) Linux is a fundamental step to deploy these types of applications.

In this guide, we will show you how to install Node.js and npm (the Node.js package manager) on your Linux VPS, ensuring your environment is ready for your JavaScript projects. Whether you have a VPS from PlatiniumHost or any other provider, the steps will be very similar to configure it correctly.

Prerequisites

  • A Linux VPS (this guide will focus on Debian/Ubuntu-based distributions like Ubuntu 20.04 or Debian 11).
  • SSH access to your VPS.
  • A user with sudo privileges.

Step 1: Update the system

It's good practice to start by updating your system's packages to ensure you have the latest versions and security patches. Connect to your VPS via SSH and run the following commands:

sudo apt update
sudo apt upgrade -y
Tip: The 'sudo apt upgrade -y' command will update all installed packages without asking for confirmation, which is convenient for keeping your system up to date.

Step 2: Install build tools

Some Node.js modules or npm dependencies may require compilation from source code during installation. To handle this, it is necessary to install essential build tools. This includes build-essential (which contains a C/C++ compiler, make, etc.) and curl (for downloading files) or git (for cloning repositories).

sudo apt install build-essential curl git -y

Step 3: Install Node.js using NVM (Node Version Manager)

The most recommended and flexible way to install Node.js is by using NVM. NVM allows you to install and manage multiple versions of Node.js on the same system, which is extremely useful if you work with different projects that require different Node.js versions.

What is NVM?

NVM (Node Version Manager) is a simple shell script that allows you to easily install, uninstall, and switch between different versions of Node.js and npm on your machine. This avoids conflicts and gives you full control over your development and production environment.

Download and Install NVM

You can download and install NVM by running the following command. Make sure to check the NVM GitHub page for the latest stable version.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Tip: Visit the official NVM repository on GitHub (github.com/nvm-sh/nvm) to get the latest version of the installation script and replace 'v0.39.7' if a newer one is available.

After installation, you will need to reload your shell or open a new SSH session for NVM to be available. You can also run:

💬 ¿En qué podemos ayudarte?

Selecciona un agente de soporte

¿Hablamos?