We have installed node.js and npm onto all shared hosting servers.
You can use the Setup Node JS app icon in cPanel to select your Node version ranging from 9.1.2 - 20.19.3 at the time of writing, however we always keep it updated to the latest version.
npm version 8.19.4 at the time of writing, however we always keep it updated to the latest version.
These binaries are located in
/usr/bin
making ......
/usr/bin/node
/usr/bin/npm
You can use the cPanels Setup NodeJS app icon to create your Node application.
How to Create a Node.js Application using CloudLinux Setup NodeJS App
Overview
This guide will walk you through creating a Node.js application using the CloudLinux "Setup NodeJS app" feature. This tool makes it easy for beginners to deploy Node.js applications without complex server configuration.
Prerequisites
- Active hosting account with CloudLinux support
- Access to cPanel
- Basic understanding of file management
Accessing Your Hosting Control Panel
Method 1: Client Portal Login
- Visit the client portal: https://ifastnet.com/portal/clientarea.php
- Log in with your hosting account credentials
- Navigate to your hosting services
- Click on the cPanel login button for easy access
Method 2: Direct cPanel Access
- Visit: https://yourdomain.com/cpanel (replace "yourdomain.com" with your actual domain)
- Enter your cPanel username and password
Step-by-Step Guide to Setup Node.js Application
Step 1: Access the NodeJS App Setup
- Log into your cPanel using one of the methods above
- Scroll down to the "Software" section
- Look for and click on "Setup Node.js App" or "Node.js Selector"
Step 2: Create New Application
- Click the "Create Application" button
- Fill in the application details:
- Node.js Version: Select the latest stable version (recommended)
- Application Mode: Choose "Production" for live sites or "Development" for testing
- Application Root: This is where your app files will be stored (e.g.,
nodejs_app)
- Application URL: Choose the URL path where your app will be accessible
- Application Startup File: Usually
app.js or index.js
Step 3: Configure Application Settings
- Set your Application Root directory (this creates a folder in your file manager)
- Choose your Application URL - this determines how visitors access your app
- Specify the Startup File - the main file that runs your Node.js application
- Click "Create" to set up the basic structure
Step 4: Upload Your Application Files
Using cPanel File Manager:
- Go to cPanel ? File Manager
- Navigate to the Application Root directory you specified
- Upload your Node.js application files (package.json, app.js, etc.)
- Extract any zip files if needed
Using cPanel Terminal:
- In cPanel, find and click "Terminal"
- Navigate to your application directory:
cd ~/nodejs_app
- You can now use command-line tools to manage your files
Using SSH (Advanced Users):
- Connect via SSH using port 1394:
ssh [email protected] -p 1394
- Navigate to your application directory
- Upload files using SCP or manage them directly
Step 5: Install Dependencies
- In the Node.js App interface, look for the "Package.json" section
- If your app has a package.json file, the system will show available packages
- Click "Run NPM Install" to install all dependencies automatically
- Alternatively, use the Terminal to run:
npm install
Step 6: Start Your Application
- Back in the "Setup Node.js App" interface
- Click the "Start" button next to your application
- The status should change to "Running"
- Your application is now live and accessible via the URL you configured
Step 7: Test Your Application
- Visit your application URL in a web browser
- Verify that your Node.js application is working correctly
- Check for any error messages in the application logs
Managing Your Node.js Application
Restarting the Application
- Use the "Restart" button in the Node.js App interface
- Or use the Terminal to restart manually
Viewing Logs
- Check the application logs in the Node.js App interface
- Logs help diagnose any issues with your application
Stopping the Application
- Click "Stop" in the Node.js App interface when you need to make changes
Common Beginner Tips
- Start Simple: Begin with a basic "Hello World" Node.js app to test the setup
- Check File Permissions: Ensure your files have proper permissions set
- Monitor Resource Usage: Keep an eye on CPU and memory usage
- Regular Backups: Back up your application files regularly
- Keep Dependencies Updated: Regularly update your npm packages for security
Troubleshooting
Application Won't Start
- Check that your startup file exists and is correctly named
- Verify that all dependencies are installed
- Review application logs for error messages
Can't Access Application
- Confirm the Application URL is correctly configured
- Check that the application status shows "Running"
- Verify domain/subdomain settings
Permission Issues
- Ensure file permissions are set correctly (usually 644 for files, 755 for directories)
- Check that the application root directory is accessible
Getting Support
If you encounter issues that you cannot resolve:
- Visit the support portal: https://support.ifastnet.com/login.php
- First-time users: You'll need to register for an account before creating tickets
- Create a detailed support ticket describing your issue
- Include relevant error messages and steps you've already tried
Summary
The CloudLinux "Setup NodeJS app" feature simplifies Node.js deployment by handling server configuration automatically. By following these steps, you can have a Node.js application running quickly without deep technical knowledge of server management. Remember to start with simple applications and gradually work your way up to more complex projects as you become comfortable with the process.