---
title: "Install Nodejs from Nodesource"
date: 2021-05-12T15:20:05.000Z
author: Z.SHINCHVEN
tags: [Node.js, nodesource]
canonical: https://atlassc.net/2021/05/13/install-nodejs-from-nodesource
---
Nodejs is a cross-platform runtime, you can install it on almost every popular OS.

However, node's version managed by each OS' package manager can be different and obsolete.

So just install it from [nodesource](https://github.com/nodesource/distributions), the official script will take care of the package source and version.

## Debian and Ubuntu based distributions

### LTS

```bash
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
```

### Current

```bash
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs
```

## Enterprise Linux based distributions

### LTS

```bash
# As root
curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -

# No root privileges
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
```

### Current

```bash
# As root
curl -fsSL https://rpm.nodesource.com/setup_current.x | bash -

# No root privileges
curl -fsSL https://rpm.nodesource.com/setup_current.x | sudo bash -
```
