DEV Community

Manish Baral
Manish Baral

Posted on

How to install Node on cPanel shared hosting (without root access)

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:

Or you can use the terminal that is in cPanel.

screenshot where you can see the link the terminal

(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
Enter fullscreen mode Exit fullscreen mode

After that, you should be able to run node and npm from any folder.

YOU ARE DONE! HAPPY CODING!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon