DEV Community

Cover image for How to Install node.js app on VPS shared hosting?
Saad Abbasi
Saad Abbasi

Posted on

How to Install node.js app on VPS shared hosting?

In this article, I will show you how to install node.js on shared hosting
if you just purchased new shared hosting and there is not node.js installed.
Don't worry in this step-by-step guide you will learn to install node.js with SSH without sudo or root access.
I am a Windows user, for connecting to the server via SSH i will use putty software that's free and easy to use.
I assume that you have already installed putty if not just google you will see lots of tutorials on How to install putty on windows.

How to use putty?

search putty in your window's search bar and click on putty to execute.

You will see the following screen

How to Install node.js app on VPS shared hosting?
Enter the following values in putty for connecting to the server
1.Enter Your Server/cPanel IP Address in * hostname (or IP address field*

  1. By Default Port 22 is used if you have not default case you You Can Find Your Port Number in Server Details
  2. Click on Open Button if everything is correct you will see a black screen asking for Login as enter your username here make sure to enter correct user name Enter password Enter the correct password for username. *password will not be visible just type your password and hit enter If You Enter the Correct cPanel Username and Password then you will see the next screen with your username.

Now you are connected to Server successfully let's install node.js on shared hosting

Run the following command to download node.js you can download any version of node.js by changing the to a specific version. i am downloading v8.10.0

wget https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz
Enter fullscreen mode Exit fullscreen mode

Now we have downloaded node.js on our server let's Extract Node JS Files by using the following command

tar xvzf node-v8.10.0-linux-x64.tar.gz
Enter fullscreen mode Exit fullscreen mode

Let's rename the folder to nodejs

mv node-v8.10.0-linux-x64 nodejs
Enter fullscreen mode Exit fullscreen mode

Let's install Node.js and npm type the following commands one by one

  1. mkdir ~/bin
  2. cp nodejs/bin/node ~/bin
  3. cd ~/bin
  4. ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm #That's it. Node.js and npm installed on your hosting you can verify that by running node -v if yo see node.js version it's mean you have successfully installed node.js on shared/vps hosting.

Thanks for reading :-) can you write your thoughts? and help me to improve my content by your valued suggestions? or if you have any querry please comment bellow.

Top comments (1)

Collapse
 
hossamgouda profile image
Hossam Gouda

Great and easy can we do same with the latest version or we should stay with V8 only ?