Learning how to install Node.js on Debian is essential for developers, DevOps engineers, and anyone building modern JavaScript backends, APIs, real-time apps, microservices, serverless functions, or full-stack projects in 2025–2026. Node.js powers Express, NestJS, Next.js APIs, CLI tools, automation scripts, and the vast JavaScript ecosystem. Debian 10 (Buster) is still widely used in production and legacy servers, so this guide covers three proven methods to install Node.js:
- Default apt repositories — Quick & stable (v10.x or updated)
- NodeSource PPA — Latest LTS (v18/v20) or current versions (recommended for production)
- nvm (Node Version Manager) — Multiple versions side-by-side (best for developers)
You’ll also verify installation, test with a simple script, install npm, upgrade, and learn to uninstall cleanly.
Prerequisites
- Debian 10 (Buster) server or desktop
- Non-root user with sudo privileges (see Debian Initial Server Setup Guide)
- Terminal access (SSH or local)
- Internet connection
Method 1: Install Node.js on Debian 10 Using Default apt (Quick & Stable)
This uses Debian’s official repositories — ideal for basic testing or production stability.
- Update package index
sudo apt update
2. Install Node.js
sudo apt install nodejs -y
3. Verify version
node -v
Typical output (Debian 10):
v10.24.0
4. Install npm (package manager)
sudo apt install npm -y
npm -v
Output example:
6.14.18
You now have Node.js installed on Debian 10 via apt — ready for basic use.
Warning: Debian 10’s default Node.js (v10.x) is unsupported and unmaintained in 2025–2026. Use Method 2 or 3 for production.
Method 2: Install Latest Node.js on Debian 10 Using NodeSource PPA (Recommended)
NodeSource PPA provides modern LTS (v18/v20) or current versions — far better than Debian’s old v10.
- Install curl (if not present)
sudo apt install curl -y
2. Add NodeSource PPA (choose version — 2025–2026 recommendations):
- LTS: setup_20.x (Node 20 LTS – most stable)
- LTS: setup_18.x (Node 18 LTS – widely used)
- Current: setup_current
Example for Node 20 LTS:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
3. Install Node.js
sudo apt install nodejs -y
4. Verify
node -v # e.g., v20.17.0
npm -v # e.g., 10.8.x
Success! You now have a modern, supported Node.js on Debian 10.
Method 3: Install Node.js on Debian 10 Using nvm (Best for Developers)
nvm lets you install and switch between any Node version instantly — perfect for legacy code, testing, or multiple projects.
- Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Close & reopen terminal (or run):
source ~/.bashrc
2. Install latest LTS
nvm install --lts
nvm use --lts
nvm alias default lts/*
Or specific version:
nvm install 20
nvm use 20
3. Verify
node -v
npm -v
Switch anytime:
nvm install 18
nvm use 18
nvm ls # list installed
nvm ls-remote # all available versions
Step 4 – Test Your Node.js Installation
Create a test file:
nano hello.js
Paste:
console.log("Hello from Node.js on Debian 10!");
console.log("Node version:", process.version);
console.log("Platform:", process.platform);
Save & exit (Ctrl+O → Enter → Ctrl+X).
Run:
node hello.js
Output example:
Hello from Node.js on Debian 10!
Node version: v20.17.0
Platform: linux
Success!
Step 5 – Upgrade, Uninstall & Troubleshooting
Upgrade Node.js
- Apt: sudo apt update && sudo apt upgrade nodejs
- NodeSource: Re-run PPA setup → sudo apt upgrade nodejs
- nvm: nvm install node –reinstall-packages-from=current
Uninstall Node.js
- Apt: sudo apt remove –purge nodejs npm && sudo apt autoremove
- nvm: nvm uninstall <version> (e.g., nvm uninstall 20)
Common Issues on Debian 10
- E: Unable to locate package nodejs → Run sudo apt update first
- npm permission errors → Fix global installs:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
Add to ~/.bashrc and source ~/.bashrc.
- Old Node version after install → Use NodeSource PPA or nvm for latest
How to Install Node.js on Debian – FAQ (2025–2026)
- How do I install Node.js on Debian 10?
Best: NodeSource PPA → curl setup_20.x | sudo bash – → sudo apt install nodejs - What’s the latest Node.js LTS in 2025–2026?
v20 or v22 — NodeSource PPA or nvm gives you the latest on Debian 10 - How do I use multiple Node.js versions on Debian?
Use nvm: nvm install 18, nvm install 20, nvm use 20 - Is npm included with Node.js?
Yes — in NodeSource/nvm installs; separate package in default apt - How do I update Node.js on Debian 10?
NodeSource: sudo apt update && sudo apt upgrade nodejs nvm: nvm install node –reinstall-packages-from=current
Summary
You now know exactly how to install Node.js on Debian 10: fast apt method, modern NodeSource PPA (latest versions), and nvm for version control — plus verification, first script, npm, and troubleshooting.
Mastering how to install Node.js on Debian unlocks full-stack JavaScript, APIs, web servers, automation, and modern development workflows.