> For the complete documentation index, see [llms.txt](https://kermitcloud.gitbook.io/kermitcloud-hosting-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kermitcloud.gitbook.io/kermitcloud-hosting-wiki/vps-servers/how-to-install-node.js.md).

# How To Install Node.js

Installing Node.js  on your VPS or local machine is straightforward! Here’s a step-by-step guide for various systems:

#### **For Ubuntu/Debian-based VPS Servers**:

1. **Update your package list**:

   bash

   ```
   sudo apt update
   ```
2. **Install Node.js  from the default repository** (may not have the latest version):

   bash

   ```
   sudo apt install nodejs
   sudo apt install npm
   ```
3. **Install the latest version using NodeSource** (recommended):
   * Add NodeSource repository:

     bash

     ```
     curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
     ```

     *(Replace* `16.x` *with your desired version, such as* `18.x`*.)*
   * Install Node.js:

     bash

     ```
     sudo apt install -y nodejs
     ```
4. **Verify installation**:

   bash

   ```
   node --version
   npm --version
   ```

#### **For CentOS/RHEL-based VPS Servers**:

1. **Add NodeSource repository**:

   bash

   ```
   curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
   ```

   *(Replace* `16.x` *with your preferred Node.js  version.)*
2. **Install Node.js**:

   bash

   ```
   sudo yum install -y nodejs
   ```
3. **Check installation**:

   bash

   ```
   node --version
   npm --version
   ```

#### **Using NVM (Node Version Manager)**:

If you want flexibility in managing Node.js  versions:

1. **Install NVM**:

   bash

   ```
   curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
   source ~/.bashrc
   ```
2. **Install Node.js**:

   bash

   ```
   nvm install 18
   nvm use 18
   ```
3. **Check installation**:

   bash

   ```
   node --version
   npm --version
   ```
