Have you ever wondered how to install Node.js on shared hosting using cPanel without root or sudo access? If so, you're in the right place. This guide will walk you through the process step by step, making it easy for beginners to follow along.
Step 1: Logging in via SSH
The first step is to log in to your hosting account via SSH. This will bring you to the command line interface where you can input commands directly to your server.
Step 2: Creating a New Folder for Node
Once you're logged in, you'll need to create a new folder for Node.js. To do this, use the following commands:
mkdir node cd node
Step 3: Downloading and Unzipping Node
Next, you'll need to download Node.js and unzip it. You can do this with the following commands:
curl -O https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz
tar -xvzf node-v16.13.0-linux-x64.tar.gz --strip-components=1
First try to install from whm using apache
Step 4: Adding Node and npm to PATH
The next step is to add Node and npm to your PATH. This will allow you to run Node and npm from any folder. You can do this with the following commands:
export PATH=$PATH:/opt/cpanel/ea-nodejs16/bin/
Step 5: Testing Your Installation
Now that you've installed Node.js, it's a good idea to test it to make sure everything is working correctly. You can do this by running the following commands:
node -v npm -v
Potential Limitations
While this process should work for most shared hosting providers, there may be some limitations depending on your specific host. For example, on VentraIP, you may not be able to use Node to compile VuePress due to limits on the number of threads each account can create. However, other commands should work fine.
Conclusion
Installing Node.js on shared hosting using cPanel without root or sudo access may seem complicated, but it's actually quite straightforward when you break it down into steps. By following this guide, you should be able to get Node.js up and running on your shared hosting account in no time.