
Using SSH in cPanel to Manage Node.js Applications on Hiverift
Using SSH in cPanel to Manage Node.js Applications on Hiverift
SSH (Secure Shell) access is a powerful tool for managing Node.js applications directly from the command line. If you’re hosting your Node.js app on Hiverift, SSH access through cPanel gives you full control for installing packages, starting apps, viewing logs, and managing environment variables. Here’s how to set it up and use it effectively.
π Step 1: Enable SSH Access in Hiverift cPanel
- Log in to your Hiverift cPanel.
- Go to Security section and click on SSH Access.
- Click Manage SSH Keys if you want to use key-based authentication (recommended).
- Alternatively, get your SSH login credentials (host, port, username, password).
π§βπ» Step 2: Connect via SSH
Use a terminal (macOS/Linux) or PuTTY (Windows) to connect:
ssh username@yourdomain.com -p 22
If prompted, enter your password or provide the private key.
π Step 3: Navigate to Your Application Directory
After login, move to your Node.js application folder:
cd ~/myapp
Use ls
to list files and ensure you’re in the right directory.
π¦ Step 4: Install Node.js Dependencies
If you’ve uploaded your Node.js app using File Manager or Git, install its dependencies:
npm install
This installs all the modules listed in your package.json
.
π Step 5: Run Your Application
Start your app manually using:
node server.js
Or use a process manager like pm2
for better control (if available):
npx pm2 start server.js
To keep the app running after you log out:
nohup node server.js &
π§ͺ Step 6: View Logs and Debug Errors
-
- View the default output of your Node.js app:
cat nohup.out
-
- Check error logs (if applicable):
cat error.log
π Step 7: Restart App After Making Changes
After editing files via SSH or File Manager, restart the app:
killall node
node server.js
π Useful Commands Summary
cd
β change directoryls
β list filesnpm install
β install packagesnode app.js
β run appnano .env
β edit environment variablestail -f nohup.out
β live log monitor
π‘ Tips for SSH on Shared Hosting
- Always test commands locally before running on server
- Use
.env
and thedotenv
package for sensitive data - Use
screen
ortmux
(if available) to maintain sessions - Use Git inside SSH to pull project updates directly
π Conclusion
SSH access on Hiverift gives you developer-grade control over your Node.js apps. You can run, restart, debug, and deploy applications with precision. When combined with cPanelβs Node.js environment setup, SSH becomes an essential part of your deployment and maintenance workflow.