Install latest Node.js on Ubuntu 25.10 with a signed NodeSource APT repository and have node and npm working in about ten minutes. You will also run a private HTTP smoke test, so you can confirm the runtime works without exposing an application port to the internet.
Prerequisites
- A 64-bit Ubuntu 25.10 server, code-named Questing, with at least 1 GB of RAM and 2 GB of free disk space.
- SSH access as
root, or a normal user with workingsudoprivileges. - Outbound HTTPS access to Ubuntu mirrors and
deb.nodesource.com. - No domain is needed for the installation or the localhost-only test.
- A VPSLake Linux VPS if you need a root-access Ubuntu server for Node.js projects.
Ubuntu 25.10 is an interim release, not an LTS release, and its published support window ends in July 2026. If you are setting up a new production server after that date, choose a supported Ubuntu release instead; the commands below assume the Questing package sources still return normally.
The commands use sudo. If you are logged in as root, remove sudo from each command.
Step 1: Confirm Questing and refresh APT
Confirming the release first prevents you from applying a repository setup intended for a different Ubuntu series.
. /etc/os-release
printf 'ID=%s\nVERSION_ID=%s\nVERSION_CODENAME=%s\n' "$ID" "$VERSION_ID" "$VERSION_CODENAME"
dpkg --print-architecture
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
The release check should show Ubuntu 25.10 and the questing codename. NodeSource’s current Debian-style packages support the common amd64 and arm64 architectures.
ID=ubuntu
VERSION_ID="25.10"
VERSION_CODENAME=questing
amd64
If apt-get update reports 404 errors from the Ubuntu mirrors, do not bypass the errors or disable signature checking. Ubuntu 25.10 is an interim release; upgrade the server to a supported release before continuing.
Step 2: Add the current Node.js APT repository
The source post calls this a PPA, but NodeSource is actually a signed third-party APT repository. Its current-release script installs the keyring and source definition without the deprecated apt-key workflow.
Download the official setup script locally, run it with sudo, and remove the temporary copy afterward:
curl -fsSL https://deb.nodesource.com/setup_current.x -o /tmp/nodesource-setup-current.sh
sudo -E bash /tmp/nodesource-setup-current.sh
rm -f /tmp/nodesource-setup-current.sh
The script refreshes APT and creates /etc/apt/sources.list.d/nodesource.sources. Check the repository entry before installing the package:
sudo grep -E '^(URIs|Suites|Components|Architectures|Signed-By):' /etc/apt/sources.list.d/nodesource.sources
apt-cache policy nodejs | sed -n '1,9p'
You should see a NodeSource URI, the nodistro suite, and a non-empty candidate. The current major can change over time; at the time of writing, the current selector points to the Node.js 26 line.
URIs: https://deb.nodesource.com/node_26.x
Suites: nodistro
Components: main
Architectures: amd64
Signed-By: /usr/share/keyrings/nodesource.gpg
Candidate: 26.x.y-1nodesource1
For the repository’s supported setup variants, see the NodeSource Debian and Ubuntu instructions.
Step 3: Install Node.js and npm
The NodeSource nodejs package includes npm, so installing one package gives you the runtime and the standard JavaScript package manager.
sudo apt-get install -y nodejs
node --version
npm --version
command -v node
command -v npm
The major version should match the candidate shown in Step 2, while patch and npm versions may change as the repository is updated.
v26.x.y
11.x.y
/usr/bin/node
/usr/bin/npm
If an older Ubuntu nodejs package was already installed, APT should select the NodeSource candidate because the setup script adds an APT preference for it. Confirm with apt-cache policy nodejs if the major version is unexpected.
Step 4: Run a localhost HTTP smoke test
This test proves that Node.js can load its built-in HTTP module and answer a request while listening only on the loopback interface.
node -e 'require("node:http").createServer((request, response) => response.end("Node.js is working on Ubuntu 25.10\n")).listen(3000, "127.0.0.1")' >/tmp/node-questing-test.log 2>&1 &
NODE_PID=$!
sleep 1
curl --fail --silent http://127.0.0.1:3000
kill "$NODE_PID"
wait "$NODE_PID" 2>/dev/null || true
The request should return the following line. Because the server binds to 127.0.0.1, you do not need a UFW rule for this temporary check.
Node.js is working on Ubuntu 25.10
For a public application, put Node.js behind a TLS-enabled reverse proxy and open only the ports it needs. Do not run the application as root just to bind a low-numbered port.
Verify the Node.js installation
Run these checks to confirm the runtime, npm, architecture, built-in modules, and APT origin are all consistent:
node --version
npm --version
node -p 'process.platform + " " + process.arch'
node -e 'console.log(typeof require("node:fs").readFileSync === "function" ? "Built-in module check passed" : "Built-in module check failed")'
apt-cache policy nodejs | sed -n '1,8p'
Expected output includes a v26 release from the current selector, a numeric npm version, linux amd64 or linux arm64, a passed module check, and a candidate whose origin is deb.nodesource.com. Node.js APIs and runtime behavior are documented in the official Node.js API reference.
Troubleshooting
E: Failed to fetch ... questing ... 404 Not Found
Ubuntu 25.10 is an interim release and its repositories are no longer on the normal mirrors after the support window closes. Do not change the codename to another release or use an unsigned archive; back up the server and upgrade or reinstall it with a currently supported Ubuntu release, then repeat this guide.
node still shows an old major version
The NodeSource script may not have completed, or your shell may still have a cached path. Inspect the candidate and clear Bash’s command cache before reinstalling:
hash -r
command -v node
apt-cache policy nodejs
sudo apt-get update
sudo apt-get install --only-upgrade -y nodejs
node --version
The policy output should contain https://deb.nodesource.com/node_26.x for the current branch. If it does not, rerun Step 2 and read its first error before installing again.
Could not resolve host: deb.nodesource.com
This is a DNS or outbound-network problem, not a Node.js package problem. Test name resolution and HTTPS separately:
getent hosts deb.nodesource.com
curl -I https://deb.nodesource.com
An address from getent and an HTTPS response indicate that the repository is reachable. If either check fails, fix the VPS resolver, route, or provider-level egress restriction and then rerun Step 2.
npm ERR! EACCES when installing a global package
APT-managed Node.js places global binaries under a system-owned prefix, so a regular user cannot write there. Prefer project-local dependencies:
mkdir -p ~/YOUR_APP
cd ~/YOUR_APP
npm init -y
npm install YOUR_PACKAGE
Replace YOUR_APP with your application directory and YOUR_PACKAGE with the dependency name. This keeps the project files owned by your account; use a version manager if you specifically need several Node.js majors on one server.
Hardening and next steps
- Run production services under a dedicated non-root account and supervise them with systemd rather than leaving a shell process running.
- Keep
package-lock.jsonin version control, store secrets outside the repository, and reviewnpm auditresults before changing production dependencies. - If the application is public, allow only the required SSH, HTTP, and HTTPS ports in UFW. The VPSLake UFW firewall generator can help draft a narrow ruleset for review.
- Track the Node.js release line your application supports. Current releases move quickly; choose the LTS selector for production when your dependencies do not require the newest features.
FAQ
Is NodeSource the same thing as an Ubuntu PPA?
No. A PPA is normally hosted through Launchpad, while NodeSource provides a signed APT repository. The installation experience is similar, but the source entry and signing key are managed by NodeSource.
Why does the repository use nodistro on Ubuntu 25.10?
NodeSource’s current setup script publishes a distribution-neutral APT entry and uses the Ubuntu system architecture. nodistro is intentional here; it avoids pretending that the package feed is a native Launchpad archive for Questing.
Should I install the current release or Node.js LTS?
The current selector is useful when you need the newest runtime features and have checked dependency compatibility. For a long-lived production service, the LTS selector is usually the steadier choice; replace setup_current.x with setup_lts.x in Step 2 before running the script.
Can I install more than one Node.js version?
APT is best suited to keeping one system-wide Node.js branch active. If different applications require different majors, use a per-user version manager and keep production services explicit about the Node binary they run.