Getting Started with NodeJS

Getting Started | Updated March 2026

Node.js is a JavaScript runtime that lets you run server-side applications — APIs, real-time apps, microservices, and full web applications — using the same language you already know from front-end development. Ultra Web Hosting supports Node.js through CloudLinux’s Node.js Selector in cPanel, giving you a managed environment to deploy and run your applications without needing a VPS or dedicated server.

01. What Is Node.js?

Node.js is an open-source, cross-platform runtime environment built on Chrome’s V8 JavaScript engine. Before Node.js, JavaScript could only run in web browsers. Node.js changed that by allowing JavaScript to run on a server, handling tasks like reading files, connecting to databases, and responding to HTTP requests.

Traditional web hosting languages like PHP process each request independently — a new request comes in, PHP handles it, sends a response, and the process ends. Node.js works differently. It uses an event-driven, non-blocking I/O model, which means it can handle thousands of simultaneous connections without creating a new thread for each one. This makes it especially efficient for real-time applications, APIs, and anything that handles many concurrent users.

Node.js comes with npm (Node Package Manager), the world’s largest ecosystem of open-source libraries. With over two million packages available, you can add functionality to your application — database drivers, authentication, templating, image processing — with a single npm install command.

One language everywhere. If you know JavaScript for front-end development, you already know the language for your back end. This eliminates context-switching between languages and lets a single developer (or team) work across the entire stack.

Speed and efficiency. The V8 engine compiles JavaScript to machine code, making Node.js fast. Its non-blocking architecture handles I/O operations (database queries, file reads, API calls) without waiting for each to finish before starting the next, which is ideal for I/O-heavy workloads.

Massive ecosystem. npm hosts over two million packages covering everything from web frameworks (Express, Fastify, Koa) to database connectors (Mongoose, Sequelize, Knex) to utility libraries (Lodash, Moment, Day.js). Whatever you need, there’s likely a well-maintained package for it.

Active community. Node.js has one of the largest developer communities in the world. Stack Overflow, GitHub, and dedicated forums provide extensive documentation, tutorials, and support. Major companies including Netflix, PayPal, LinkedIn, Uber, and NASA use Node.js in production.

Modern frameworks. Node.js powers popular frameworks like Next.js (React-based full-stack framework), Nuxt.js (Vue-based), Express (minimal API framework), and Nest.js (enterprise-grade TypeScript framework). These frameworks make it fast to build production-ready applications.

03. Common Use Cases

Node.js is well-suited for a wide range of applications:

  • REST APIs and GraphQL servers — lightweight, fast API endpoints for mobile apps, SPAs, or third-party integrations
  • Real-time applications — chat apps, live notifications, collaborative editing, and dashboards using WebSockets
  • Server-side rendered websites — frameworks like Next.js and Nuxt.js render pages on the server for better SEO and performance
  • Microservices — small, focused services that each handle one task, communicating over HTTP or message queues
  • Command-line tools — build scripts, automation tools, and development utilities
  • Proxy servers and middleware — lightweight intermediaries between your front end and back-end services
Good to know: Node.js excels at I/O-bound tasks (database queries, API calls, file operations). For CPU-intensive tasks like image processing or complex calculations, consider offloading that work to a dedicated service or using Node.js worker threads.

04. Setting Up Node.js in cPanel

Ultra Web Hosting uses CloudLinux’s Node.js Selector to manage Node.js applications. Here’s how to create and deploy your first app:

  1. Log in to cPanel and scroll to the Software section. Click “Setup Node.js App”.
  2. Click “Create Application” in the top-right corner.
  3. Configure the application:
    • Node.js version: Choose your preferred version (LTS versions like 18.x or 20.x are recommended for production).
    • Application mode: Set to Development while building, switch to Production when ready.
    • Application root: The directory containing your app files (e.g., myapp). This is relative to your home directory.
    • Application URL: The domain or subdomain where the app will be accessible.
    • Application startup file: The entry point for your app, typically app.js or server.js.
  4. Click “Create” to save the application.
  5. Upload your files to the application root directory using File Manager or FTP.
  6. Install dependencies. In the Node.js Selector, click “Run NPM Install” to install packages from your package.json.
  7. Start the application by clicking the “Start App” button (or “Restart” if it’s already running).
Important: Your Node.js app must listen on the port provided by the environment, not a hardcoded port. Use process.env.PORT or the Phusion Passenger integration will handle port binding for you. Do not hardcode app.listen(3000) in production — the CloudLinux/Passenger layer manages the port automatically.

05. Application File Structure

A basic Node.js application on Ultra Web Hosting looks like this:

myapp/
  app.js              # Entry point (startup file)
  package.json        # Dependencies and scripts
  package-lock.json   # Locked dependency versions
  node_modules/       # Installed packages (created by npm install)
  public/             # Static files (CSS, images, client JS)
  views/              # Templates (if using a template engine)
  routes/             # Route handlers
  .env                # Environment variables (never commit this)

A minimal app.js using Express:

const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello from Node.js on Ultra Web Hosting!');
});

// Let Passenger handle the port
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

And the corresponding package.json:

{
  "name": "myapp",
  "version": "1.0.0",
  "main": "app.js",
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "^4.18.0"
  }
}

06. Installing npm Packages

You can install npm packages in two ways:

Through cPanel: In the Node.js Selector, there is an “Add Package” section where you can type a package name and install it directly. You can also click “Run NPM Install” to install all dependencies listed in your package.json.

Through SSH (Terminal): If you have SSH access, you can install packages from the command line. First, enter the virtual environment created by the Node.js Selector:

source /home/username/nodevenv/myapp/18/bin/activate
cd ~/myapp
npm install express
npm install
Tip: Always run npm install within the Node.js virtual environment. If you install packages outside of it, they may use a different Node.js version and cause compatibility issues.

07. Environment Variables

Store sensitive configuration (database credentials, API keys, secrets) in environment variables rather than hardcoding them in your source files.

Using the Node.js Selector: The cPanel interface has an Environment Variables section where you can add key-value pairs. These are injected into process.env automatically when your app starts.

Using a .env file: Create a .env file in your application root and use the dotenv package to load it:

# .env
DB_HOST=localhost
DB_USER=myuser
DB_PASS=mypassword
API_KEY=abc123
// app.js
require('dotenv').config();
console.log(process.env.DB_HOST); // localhost
Security: Never commit your .env file to version control. Add it to your .gitignore. If your application is in a public directory, make sure the .env file is not web-accessible.

08. Troubleshooting

  1. App shows “Application Error” or a blank page. Check the error log in the Node.js Selector. Common causes include a missing startup file, a syntax error in your code, or missing dependencies (run NPM Install again).
  2. “Cannot find module” errors. Your node_modules directory may be missing or incomplete. Click “Run NPM Install” in the Node.js Selector, or SSH in and run npm install inside the virtual environment.
  3. App runs locally but not on the server. Make sure you are not hardcoding a port. Use process.env.PORT or simply omit the app.listen() port argument and let Passenger handle it.
  4. Changes not showing up. Click “Restart” in the Node.js Selector after uploading new files. Node.js does not automatically detect file changes in production mode.
  5. Wrong Node.js version. If your app requires a specific Node.js version, change it in the Node.js Selector dropdown. After changing versions, run NPM Install again to rebuild native modules.
  6. Memory limits. On shared hosting, your application has memory limits enforced by CloudLinux. If your app exceeds its allocation, it will be terminated. Optimize your code, reduce memory usage, or consider upgrading to a VPS or dedicated server for resource-intensive apps.

Need Help With Your Node.js App?

If you’re having trouble deploying or running a Node.js application, open a ticket and we’ll help you get it working.

Open a Support Ticket

Quick Recap: Node.js on Ultra Web Hosting

  1. Create your app in cPanel → Setup Node.js App → Create Application
  2. Upload your files to the application root directory
  3. Install dependencies — click “Run NPM Install” in the Node.js Selector
  4. Start the app and test it at your configured URL
  5. Use environment variables for secrets — never hardcode credentials
  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

Web Hosting Pitfalls Which You Must Avoid

Obsolete | 2026 This Article Is Outdated This article has been replaced by our updated...

I want to run my own log analysis tool - Where are my logs?

Getting Started | Updated 2026 Your hosting account generates access logs and error logs that...

How to Install Shopping Cart Software

Getting Started | Updated March 2026 The easiest way to add a shopping cart or e-commerce to...

Why can I not telnet into my server? What is SSH?

Article Updated This article has been consolidated Telnet and SSH information is now in...

Learn the Basics

Getting Started | Updated 2026 New to web hosting? Here is a quick overview of the essential...



Save 30% on web hosting - Use coupon code Hosting30