Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The reliable way to install Node.js with NVM on a Linux VPS is to run NVM as the same non-root user that will run your application, load NVM in that user’s shell, install either the current LTS line or a pinned release, and set a default alias. NVM stays in that user’s home directory, so each account can keep its own Node versions without replacing the operating system’s packages.

What NVM does on a VPS

NVM is a per-user, per-shell version manager for Node.js on POSIX systems. The nvm project describes it as a way to “quickly install and use different versions of node via the command line.” Instead of replacing the distribution’s Node package, NVM downloads Node releases into the account’s home directory and changes that account’s PATH when a shell loads NVM.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This scope has two operational consequences:

  • Installing NVM as root does not install it for another SSH user. The application account must run its own installation.
  • The nvm command is a shell function, not a permanently available system binary. A new shell must read the profile loader, or a script must source nvm.sh explicitly.

NVM is useful when a VPS hosts applications with different Node requirements, when you need to pin a release for repeatable deployments, or when you want to test a newer release without disturbing a system-managed installation.

Before you install

Use the application’s deployment account

Log in as the account that will own the source code and run the service. A common arrangement is a dedicated account such as deploy, rather than root. If you install under one account and launch the application under another, the second account will not see the first account’s NVM directory or version aliases.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Confirm the operating system and architecture

NVM supports POSIX systems, but the available Node binaries depend on the VPS operating system, CPU architecture, and C library. You can record the host details before troubleshooting an installation:

cat /etc/os-release
uname -m

Prebuilt binaries are normally available for mainstream Linux distributions. Unsupported architectures and some musl-based systems can make NVM compile Node from source instead, which takes substantially longer on a small VPS.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Have administrative access for prerequisites

On Debian or Ubuntu, you need sudo access to update package metadata and install curl. A source build may also require the compiler and OpenSSL development packages described later.

Install NVM on Debian or Ubuntu

1. Install curl

Refresh package metadata and install the download utility while logged in as the deployment user:

sudo apt update
sudo apt install -y curl

The apt commands modify system packages; the NVM installation that follows is written to your user account.

2. Run the versioned NVM installer

Use the versioned installer shown below rather than an unpinned “latest” URL. Pinning the installer makes provisioning easier to reproduce:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash

The installer creates NVM under the home directory. Unless XDG_CONFIG_HOME is set, the location is $HOME/.nvm. When that variable is set, the installer uses $XDG_CONFIG_HOME/nvm.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

It also attempts to add a loader to the account’s shell profile. The loader has this form:

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

Review downloaded scripts in security-sensitive environments before piping them to a shell. In automated provisioning, keep the installer version fixed and record the account and profile being modified.

3. Reload the shell profile

The current shell does not automatically gain functions that were added to a profile after it started. Either open a new SSH session or source the profile used by the account:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
source ~/.bashrc

If the account uses a different startup file, source that file instead. The important test is the exact shell that will run your commands, not a profile belonging to another user.

4. Verify that NVM is loaded

command -v nvm
nvm --version

command -v nvm should identify the shell function, and nvm --version should print the installed NVM release. If either command fails, stop here and fix profile loading before installing Node.

Install and select a Node.js version

Install the current LTS line

For an application that follows the current long-term-support policy, install the LTS alias:

nvm install --lts

This asks NVM to resolve and install the current LTS line available to it. The exact Node release can change as the LTS line receives updates, so deployments that require byte-for-byte repeatability should pin an exact release instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Install a major line or exact release

Use a major version when the application supports any compatible patch release, or an exact version when the deployment policy names one:

nvm install 22
nvm install 22.14.0

Choose the value that matches the application’s documented support range, lockfile policy, and production approval process. Installing a version does not by itself make every existing shell switch to it.

Inspect installed versions and switch between them

nvm ls
nvm use 22
node -v
npm -v

nvm ls lists versions already installed for this account. nvm use 22 changes the current shell’s PATH; the two version checks confirm which Node and npm executables that shell is using. Run these checks as the same user and in the same kind of shell used by the application.

Make the intended version survive a reconnect

Without an explicit alias, the first version installed becomes NVM’s default for new shells. Set the default to the version your application should use:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
nvm alias default 22

Replace 22 with the major or exact version selected by your policy. New login shells will select that alias after loading NVM. The alias does not alter a shell that is already running; use nvm use there, or reconnect and verify:

node -v
npm -v

If a reconnect still reports the wrong version, check which profile SSH reads and whether another package manager places a different node earlier in PATH.

Use a project-specific version with .nvmrc

A project can record its desired Node version in an .nvmrc file. Keep that value aligned with the application’s lockfile and deployment policy. In the project directory, run:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
nvm use

NVM reads the version recorded by .nvmrc and selects it if that version is installed. If it is not installed, install the approved major or exact release first, then run nvm use again. Treat the file as project configuration: review changes to it alongside dependency and runtime changes rather than allowing a developer’s local version to become an accidental production choice.

Make NVM work in services, cron, and deployment scripts

Interactive login shells often read ~/.bashrc; service managers and scheduled jobs generally do not. Because NVM is a shell function, a non-interactive process must source nvm.sh explicitly or call the selected Node binary by its full path.

Source NVM in a service command

A systemd service can start a shell, load the application user’s NVM installation, select the approved version, and then replace the shell with the Node process:

[Service]
User=deploy
WorkingDirectory=/srv/myapp
Environment=NODE_ENV=production
ExecStart=/bin/bash -lc 'source "$HOME/.nvm/nvm.sh" && nvm use 22 && exec node server.js'

Adjust the user, working directory, version, and entry point to your application. Test the unit in the same account and environment it will use in production. Loading NVM in your own SSH session does not prove that systemd can load it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use an absolute Node path when appropriate

After selecting the approved version in the application account, run:

command -v node

The resulting path can be used in a service or deployment script without relying on shell initialization. If you later change the Node version, update that path deliberately and test the service rather than assuming the alias will be applied automatically.

Apply the same rule to cron and release scripts

At the beginning of a script, define NVM_DIR, source nvm.sh, select the required version, and only then invoke Node-based commands. Alternatively, invoke the full path returned by command -v node. Always test the exact non-interactive execution context; a command that works in an SSH prompt can fail in cron because no profile was read.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to do with an existing system Node installation

A Debian or Ubuntu package may already provide a system-wide Node executable. NVM can select that installation when needed:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
nvm use system

This is useful while transitioning an application or diagnosing which executable the operating system supplies. To restore the prior PATH state after using NVM, run:

nvm deactivate

Do not mix apt-managed and NVM-managed Node versions casually. Document which one a service uses, confirm command -v node in that service’s context, and keep the chosen source consistent across provisioning and upgrades.

When installation compiles Node from source

NVM prefers an official prebuilt binary when one matches the VPS. Unsupported CPU architectures and some musl-based systems may not have a matching binary, so NVM falls back to a source build. Compilation can be slow or fail on a small VPS because it uses CPU, memory, disk space, and network time.

On Debian or Ubuntu, install the common build prerequisites before retrying a source installation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt update
sudo apt install -y build-essential libssl-dev

If the build still fails, read the first concrete compiler or dependency error rather than repeatedly rerunning the installer. Check the architecture, available disk space, and memory, and confirm that the selected Node release supports the host environment. A prebuilt release, when available for the VPS, avoids the cost of compilation.

Troubleshoot the common VPS failures

Symptom Likely cause Fix
nvm: command not found immediately after installation The current shell has not read the profile change. Run source ~/.bashrc or reconnect over SSH, then run command -v nvm and nvm --version.
NVM works for one account but not another NVM is installed per user, under the installing account’s home directory. Install and configure NVM while logged in as the account that owns and runs the application.
The installer edited the wrong profile The account uses a different startup file from the one the installer selected. Set PROFILE to the intended profile and rerun the versioned installer, then source that profile.
SSH shows one Node version, but a service shows another The service is non-interactive and did not load NVM, or a system Node appears earlier in its PATH. Source nvm.sh in the service or use an absolute Node path; verify with command -v node in the service context.
Node changes in the current shell but reverts after reconnecting No default alias was set, or the login profile is not loading NVM. Run nvm alias default <version>, reconnect, and verify node -v.
NVM starts a long compilation No compatible prebuilt binary exists for the OS or architecture. Install build-essential and libssl-dev on Debian or Ubuntu, allow sufficient resources, and expect a slower install.
nvm use selects an unexpected project version An .nvmrc file records a different version from the one you intended. Inspect the project’s .nvmrc, align it with the application policy, install that version, and run nvm use.

NVM compared with system-wide Node installation

The right choice depends on how many applications the VPS runs and how strictly each runtime must be isolated. The following distinctions are the ones that affect operations:

Concern NVM Distribution package or system-wide installer
Installation scope Per user, under the user’s home directory. System-wide, generally managed outside an individual user’s home directory.
Multiple Node versions Install and switch among multiple versions for the account. Usually one active system version at a time unless additional tooling is introduced.
Shell behavior Requires the NVM loader in the shell or an explicit source step. The executable is normally available through the system PATH.
Version pinning Supports major or exact installs, aliases, and project .nvmrc files. Version selection follows the package repository or installer workflow.
Updates Install another approved release and change the alias or project selection. Update through the operating system or installer’s package mechanism.
Service compatibility Services must source nvm.sh or call a full Node path. Services can usually call the system executable directly.

For a single application that deliberately follows the distribution’s Node package, a system installation can be simpler. For several applications with different support windows, NVM’s per-user version selection is often the more flexible model—provided service startup and profile loading are documented.

Security and repeatable operations

  • Run the installer as the account that will execute the application, not as root merely because the VPS has administrative access.
  • Review downloaded installation scripts in security-sensitive environments. Keep the installer URL pinned to the version you have approved.
  • Record the Node major or exact release, the NVM installer version, the deployment account, and the shell profile used by automation.
  • Keep the project’s .nvmrc, dependency lockfile, and deployment configuration aligned. A runtime change without a dependency review can produce failures that look like application bugs.
  • Avoid silently mixing apt-managed Node and NVM-managed Node. Make the selected source explicit in service files and release scripts.
  • After every runtime change, verify node -v, npm -v, and command -v node as the account and execution context that will run production code.

A concise installation checklist

  1. Log in as the non-root application user.
  2. On Debian or Ubuntu, run sudo apt update and sudo apt install -y curl.
  3. Run the pinned NVM installer at v0.40.8.
  4. Open a new shell or source the profile that contains the NVM loader.
  5. Confirm command -v nvm and nvm --version.
  6. Install nvm install --lts or the approved major/exact release.
  7. Check nvm ls, select with nvm use, and verify node -v and npm -v.
  8. Set nvm alias default <version> for new login shells.
  9. Configure services and scripts to source NVM or use the full Node path.
  10. If NVM compiles from source, install the required build packages and allow for a longer build on a small VPS.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.