You can install Node.js in your own home folder without root or sudo, with nvm or the official Linux files. You need SSH access to the account.
What Node.js on shared hosting is good for
A Node.js you install yourself is fine for command line work: npm install, build tools such as Vite, Sass or Tailwind, and small scripts you run by hand or from a cron job.
It can't host a Node.js web app (Express, a Next.js server, a chat bot) that has to keep running and answer visitors on your domain. cPanel on our shared servers has no tool to start and keep such an app running. For a Node.js app, use a VPS, or build the site on your computer and upload the finished files (many frameworks can export plain HTML, CSS and JavaScript).
Option 1: install with nvm (recommended)
nvm (Node Version Manager) installs Node.js into ~/.nvm in your home folder and lets you switch versions later.
Connect to your account over SSH. See Connect to your server with SSH for the general steps; use your cPanel username and the server name from the client area.
Download and run the nvm installer (version 0.40.8 is current at the time of writing):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bashLoad nvm into the open session:
source ~/.bashrcInstall the current long-term support (LTS) release of Node.js. In November 2026 that's Node.js 26 ("Lithium").
nvm install --ltsCheck that it works:
node -v npm -vThe first command prints the Node.js version, for example
v26.13.0.
To move to a newer LTS release later, run nvm install --lts again, then nvm alias default 'lts/*' so new sessions use it.
Option 2: use the official Linux files
If you'd rather not use nvm, unpack the prebuilt Node.js files from nodejs.org into a folder in your home directory.
Check the processor type of the server:
uname -mx86_64means you need thelinux-x64files below. If it showsaarch64, replacelinux-x64withlinux-arm64in the commands.Download the latest Node.js 26 release and its checksum list, and check the download:
cd ~ curl -fsSLO https://nodejs.org/dist/latest-v26.x/SHASUMS256.txt FILE=$(grep -o 'node-v[0-9.]*-linux-x64\.tar\.gz' SHASUMS256.txt) curl -fsSLO https://nodejs.org/dist/latest-v26.x/$FILE sha256sum --check --ignore-missing SHASUMS256.txtThe last command must print the file name followed by
OK.Unpack it into
~/nodejsand remove the download:mkdir -p ~/nodejs tar -xzf "$FILE" -C ~/nodejs --strip-components=1 rm "$FILE" SHASUMS256.txtAdd Node.js to your PATH, so
nodeandnpmwork in every folder and every new session:echo 'export PATH="$HOME/nodejs/bin:$PATH"' >> ~/.bashrc source ~/.bashrc node -v npm -v
To update later, repeat steps 2 and 3. The new files replace the old ones in ~/nodejs.
Use Node.js in a cron job
Cron jobs don't read ~/.bashrc, so they don't know your PATH. Run which node over SSH and use the full path it prints in the command, for example:
/home/username/nodejs/bin/node /home/username/scripts/report.js
Replace /home/username with your real home directory (cPanel shows it under General Information). See Set up a cron job.
Common problems
"Permission denied (publickey,gssapi-keyex,gssapi-with-mic)"
The server didn't accept your key. Check that the public key is imported and shows as authorized under SSH Access in cPanel, and that your SSH program uses the matching private key. Passwords don't work for SSH on our servers.
The connection closes right after you log in
Shell access isn't turned on for the account yet. Open a ticket in cPanel Support and ask about shell access.
"node: command not found" in a new session
The PATH line is missing from ~/.bashrc, or you installed with nvm in another shell. Run tail ~/.bashrc to check, add the line again if needed, then log out and back in.
npm install or a build stops with "Killed" or "heap out of memory"
The job needed more memory than your hosting account may use. Run the install and build on your own computer and upload only the finished files (often a dist or build folder) with the File Manager.
Related articles
Still stuck? Open a support ticket and we'll help.