How to install Node.js on cPanel shared hosting (without root/sudo)

Simon East
1 min readApr 1, 2019

--

You will need to have access to an SSH command line — not all hosts allow this. I’ve tested this on VentraIP but it may work on other hosts too.

You’ll need to login via SSH and then run the following commands from the home folder. (Change the version numbers in the commands below if you’d like to use a more recent version.)

# Make a new folder for node
mkdir node
cd node
# Download and unzip node
curl -O https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.gz
tar -xvzf node-v10.15.3-linux-x64.tar.gz --strip-components=1
# Add node and npm it to PATH (and do so for future sessions too)
export PATH=$HOME/node/bin:$PATH
echo 'export PATH=$HOME/node/bin:$PATH' >> ~/.bashrc

After that you should be able to run node and npm from any folder. Test it via:

node -v
npm -v

I did find that on VentraIP I could not use Node to compile VuePress due to limits in the number of threads that each account can create. But other commands worked fine.

--

--