How to Install Node.js on Linux (Ubuntu, Debian, CentOS)

September 23, 2025 / Sales FAQ

Node.js is a popular runtime environment that enables the development of scalable and high-performance server-side applications using JavaScript. In this guide, we will show you how to install Node.js on Linux systems, including Ubuntu, Debian, and CentOS.

Install Node.js Using the Default Package Manager

  1. On Ubuntu/Debian:
    sudo apt update
    sudo apt install -y nodejs npm

    Check version:

    node -v
    npm -v
  2. On CentOS/RHEL:
    sudo yum install -y epel-release
    sudo yum install -y nodejs npm

    Check version:

    node -v
    npm -v

Note: Default repositories may not provide the latest version.

Install Node.js Using NodeSource Repository (Recommended for Latest Version)

  1. On Ubuntu/Debian:
    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
    sudo apt install -y nodejs
  2. On CentOS/RHEL:
    curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
    sudo yum install -y nodejs
  3. Verify installation:
    node -v
    npm -v

Install Node.js Using NVM (Node Version Manager)

NVM allows you to install and manage multiple Node.js versions on the same system.

  1. Install NVM
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
    source ~/.bashrc
  2. Install Latest Node.js:
    nvm install node
  3. Install a Specific Version:
    nvm install 18
    nvm use 18
  4. Check:
    node -v
    npm -v

Conclusion:

You can now run Node.js applications on your Linux server. Use the default package manager for quick setup, NodeSource for the latest stable release, or NVM for managing multiple versions. Node.js makes it easier to build fast, scalable, and modern applications. For any issues, contact our support team.

Deploying Node.js applications?
For better performance and scalability, consider using a Linux VPS environment designed for application hosting.

Want to check your server setup too? Learn HHow to check the Apache version via the shell

Spread the love