Install Node.js on cPanel shared hosting without root

cPanel

0 people found this article helpful

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.

Before you start: shell access is off on shared hosting accounts by default, so SSH logins fail until it is turned on. Open a ticket in the cPanel Support department and ask whether shell access can be turned on for your account. Our servers accept SSH logins with a key only, not with a password: add your public key under SSH Access in cPanel first.

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.

  1. 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.

  2. 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 | bash
  3. Load nvm into the open session:

    source ~/.bashrc
  4. Install the current long-term support (LTS) release of Node.js. In November 2026 that's Node.js 26 ("Lithium").

    nvm install --lts
  5. Check that it works:

    node -v
    npm -v

    The 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.

  1. Check the processor type of the server:

    uname -m

    x86_64 means you need the linux-x64 files below. If it shows aarch64, replace linux-x64 with linux-arm64 in the commands.

  2. 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.txt

    The last command must print the file name followed by OK.

  3. Unpack it into ~/nodejs and remove the download:

    mkdir -p ~/nodejs
    tar -xzf "$FILE" -C ~/nodejs --strip-components=1
    rm "$FILE" SHASUMS256.txt
  4. Add Node.js to your PATH, so node and npm work 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.


Was this answer helpful?

2FA 301 redirect 3D Secure 404 page 500 error 550 error A record accept quote access log account credit account details account password Account Preferences account security add funds addon domain address importer affiliate program AI assistant AlmaLinux 9 Android email Apache Apache virtual host API token Apple Mail Ask AI auth code authenticator app auto-renew automatic payment automatic updates autoresponder AutoSSL bandwidth billing address billing contact billing section block editor block IP bounce bounce message BoxTrapper build a WordPress website bulk email accounts business email buy domain buy hosting buy SSL certificate CalDAV calendar sync callback can't log in cancel hosting cancellation card declined CardDAV catch-all Certbot change domain WordPress change email change nameserver change package change password change payment checklist checkout choose a plan client accounts client area clone WordPress cloud server coming soon page commission company name confirmation link contact contact form Contact Information contacts control panel cPanel cPanel API cPanel contact email cPanel DNS cPanel domains cPanel email cPanel install cPanel language cPanel layout cPanel login cPanel password cPanel SSL cPanel update cPanel users create cPanel account create mailbox credit card cron cron job CRT key CA bundle CSF firewall CSV import currency custom error page Custom Nameservers custom offer dashboard data center database password database privileges database user Database Wizard date.timezone DDNS deceptive site ahead default address delete database delete old emails deny access deploy deposit device email settings Directory Privacy disk space disk usage DKIM DMARC DNS cache DNS explained DNS Records DNS Zone Management document root domain alias domain grace period Domain Hosting Domain Management domain name domain renewal domain transfer downgrade download invoice due date dynamic DNS ElySpace email account email account exists email backup email client email delivery email disk usage email filters email forwarder email history email hosting email login email migration email password email ports email preferences email quota email routing email signature email test email verification EPP code error error log error pages EV SSL expired domain expiry expiry date export database export emails fake email faster support feedback File Manager file permissions firewall first website flush DNS folder force HTTPS forgot password form email not received forward email free migration free SSL FTP account's password FTP password Galaxy email setup getting started Git GitHub Gmail Gmail app GoDaddy good ticket Google malware warning Google sign-in Google Workspace GST number Gzip compression hacked website hacked WordPress hardening help help center home server hosting hosting addons hosting glossary hosting location hosting plan Hosting Service hosting terms hosting tools hosting types hostname hostname SSL hostnamectl hotlink protection HOW TO ADD NAME SERVERS TO MY DOMAIN NAME How to create additional FTP accounts in cPanel How to create FTP accounts in cPanel How to setup name-servers for a domain htaccess htaccess redirect HTTP to HTTPS image theft IMAP IMAP settings IMAP SMTP settings import emails import SQL Imunify360 index.php virus INR install plugin install SSL certificate install WordPress instant answers invite user invoice invoice details invoice emails invoice PDF invoices IP address IP Blocker iPad iPhone email knowledgebase language large database leech protection LEMP Let's Encrypt LFD linked accounts LiteSpeed Cache live chat locked out log out login login email login problem lost email Mac Mac email mail rules mailbox mailbox check mailbox full mailbox size mailing list Mailman maintenance maintenance mode malware removal malware scan manage services mass payment max_execution_time members area memory_limit menu migrate WordPress migration request migration ticket mobile webmail money-back guarantee move email move website move WordPress site MultiPHP INI Editor MultiPHP Manager multiple accounts multiple websites MX record MX records my domains MySQL MySQL database MySQL user mysqldump nameserver Nameservers network drive new account new order newsletter Nginx Node.js notifications npm nvm open ticket Optimize Website or delete order order email out of office outage Outlook Outlook app Outlook IMAP Outlook mobile Outlook password prompt OX App Suite OX webmail page speed password protect pay all pay invoice payment payment details payment failed payment method payment methods PayPal permalinks permissions phishing phone support PHP errors PHP timezone PHP version PHP-FPM php.ini PHPMailer phpMyAdmin plugin updates point domain print invoice printer SMTP product addons products professional email profile public_html publish a post quick start quota quote quotes rating Raw Access raw access logs reading settings redemption period redirect referral link refund register register domain remove user renew domain renewal repair database reseller hosting reset admin password reset password resource usage restore WordPress revoke access revoke privileges root login Roundcube Roundcube export Roundcube identities Roundcube signature rsync backup Samsung Email scam scan to email scheduled task search Search Console self-hosted WordPress send and receive send as server IP address server location server security server status service details services session setup setup domain i setup domain name shared passwords shared vs VPS sign up single sign-on site address Sitejet Builder SMTP SMTP settings spam spam filter SpamAssassin SPF SSH SSH hardening SSH key SSL certificate static front page strong password subaccount subdomain suggestions support ticket support ticket tips support tickets suspension switch account tar test site Thunderbird ticket reply ticket status track delivery transfer website troubleshooting two-factor authentication UAPI Ubuntu Ubuntu 24.04 UFW unpaid invoice unsubscribe unzip upcp upgrade hosting UPI upload files upload_max_filesize URL forwarding user management User Manager username vacation reply VAT ID verify email Web Disk web hosting web hosting basics web server WebDAV webmail webmail From address webmail on phone webmail password website builder website email website migration website not loading Website Performance website security welcome email WhatsApp WhatsApp support whitelist WHM wildcard SSL WordPress 404 WordPress backup WordPress caching WordPress critical error WordPress email WordPress errors WordPress homepage WordPress hosting WordPress login WordPress malware WordPress Management WordPress menu WordPress offline WordPress pages WordPress password WordPress plugins WordPress post WordPress security WordPress SMTP WordPress speed WordPress staging WordPress themes WordPress transfer WordPress update WordPress URL WordPress.org vs WordPress.com WP Mail SMTP wp-admin wp-admin login wp-cron zip Zone Editor zone templates