Loading...

Knowledge Base

Purchase a HostGator Self-Managed VPS with OpenLiteSpeed + Node.js Installation

Run Node.js applications with OpenLiteSpeed + Node.js, a combination that allows OpenLiteSpeed to serve as the web server while Node.js runs the application. OpenLiteSpeed can be configured to route requests to Node.js applications, making it possible to host Node.js-based websites and applications on your Self-Managed VPS.

With OpenLiteSpeed + Node.js, you can configure Node.js applications through OpenLiteSpeed's WebAdmin Console, set up virtual hosts and application contexts, and route web traffic to your Node.js application. OpenLiteSpeed can also function as a reverse proxy for Node.js applications and support WebSocket connections when properly configured. With a Self-Managed VPS, you're responsible for configuring, maintaining, updating, and securing your server, your OpenLiteSpeed and Node.js installation, and the applications you deploy.

Key Benefits of OpenLiteSpeed + Node.js

OpenLiteSpeed and Node.js work together to provide a flexible web-serving environment for Node.js applications.

  • Node.js Application Support: Run Node.js applications through OpenLiteSpeed using an application server context.
  • Web-Based Configuration: Configure Node.js application settings through the OpenLiteSpeed WebAdmin Console.
  • Virtual Host Support: Configure individual virtual hosts for Node.js applications and map them to the appropriate domains.
  • Reverse Proxy Support: Route requests from OpenLiteSpeed to Node.js applications running as backend services.
  • Custom Application Settings: Configure the Node.js binary path, application type, startup file, and other supported application settings.
  • WebSocket Support: Proxy WebSocket traffic to a Node.js backend when your application requires persistent connections.
  • Static and Dynamic Content Handling: Use OpenLiteSpeed to serve static content while routing dynamic application requests to Node.js.

What Can You Do with OpenLiteSpeed + Node.js?

OpenLiteSpeed + Node.js provides the tools needed to host and manage Node.js applications through OpenLiteSpeed. You can:

  • Run Node.js Applications: Configure OpenLiteSpeed to run Node.js applications using its application server settings.
  • Configure Node.js Application Contexts: Set the application URI, location, Node.js binary path, application type, and startup file.
  • Host Node.js Websites: Configure a virtual host and domain to serve a Node.js application through OpenLiteSpeed.
  • Configure Virtual Hosts: Set up virtual hosts specifically for your Node.js applications and map them to listeners.
  • Route Requests to Node.js: Configure OpenLiteSpeed to send application requests to a Node.js backend.
  • Use Reverse Proxying: Place Node.js applications behind OpenLiteSpeed and route incoming requests to the appropriate backend application.
  • Configure Startup Files: Specify the file OpenLiteSpeed should use to start your Node.js application, such as app.js.
  • Customize the Node.js Path: Specify a custom Node.js binary location when your installation uses a non-default path.
  • Support WebSocket Applications: Configure OpenLiteSpeed to proxy WebSocket connections to a Node.js backend when required by your application.
  • Apply Configuration Changes: Use OpenLiteSpeed's configuration and restart options to apply changes to your Node.js application setup.

OpenLiteSpeed + Node.js on a HostGator Self-Managed VPS provides an environment for hosting Node.js applications while using OpenLiteSpeed to handle incoming web traffic. You can configure application contexts, virtual hosts, reverse proxy rules, and WebSocket connections to connect your Node.js applications with your websites and domains.

How to Purchase a Self-Managed VPS with OpenLiteSpeed + Node.js

Pre-configured Setup

Self-Managed VPS - Pre-configured Setup
Not sure which VPS setup is right for you? That's exactly what Pre-configured Setup is for. You'll find this option near the top of the HostGator Self-Managed VPS purchase page, and it takes the guesswork out of getting started. Just tell us what you're building—a WordPress Site, an AI Agent/Claude Code project, a Dev/Staging environment, or an eCommerce Store—and we'll automatically select the right plan, operating system, and template to match.
  • Great option if you're new to VPS or want a fast, easy setup
  • Get the recommended configuration for your project right away
  • No need to figure out the technical details yourself
  • Full flexibility to adjust settings later on
Try Pre-configured Setup and have your HostGator Self-Managed VPS ready to go in minutes!

To use OpenLiteSpeed + Node.js on HostGator, you first need to buy a Self-Managed VPS plan. Here is how to do it:

  1. Open https://www.hostgator.com/vps-hosting in your browser.
  2. Pick the plan you want and click Choose Plan.

    Self-Managed VPS - Choose Plan
     

  3. Pick a Data Center location.

    Self-Managed VPS - Data Center Locations
     

  4. On the Cart page, you can set up your server the way you want:
    1. Hardware:
      1. Pre-selected:

        You can change to a different Self-Managed VPS plan here.

        Self-Managed VPS - Pre-selected Hardware
         

      2. Configure:

        Click Configure if you want to build your own custom package.

        Self-Managed VPS - Configure
         

    2. Software:
      1. Click the Application tab.
      2. Choose OpenLiteSpeed + Node.js.

        Self-Managed VPS - OpenLiteSpeed + Node.js Software
         

      3. In the pop-up, click Confirm.

        Self-Managed VPS - OpenLiteSpeed + Node.js - Confirm
         

  5. Support & Security:

    You can add Premium Support, an optional paid add-on that gives you a dedicated specialist team for server tuning and migrations, plus priority chat and phone access. The current price is shown in your cart before you complete checkout.

    Self-Managed VPS - Premium Support
     

  6. AI Credits:

    You can add a HostGator AI Credits package, an optional paid add-on that lets you connect your application to supported LLM providers, including Claude, GPT, Gemini, and Grok, using one API key and a single bill. Supported models may change over time. The current price is shown in your cart before you complete checkout.

    Self-Managed VPS - AI Credits
     

  7. In Advanced options, you can set these up if you want:
    • Extra IPs: Add more IP addresses for an extra cost. The price depends on how many you add, and the current price is shown in your cart before you complete checkout.
    • Hostname: Give your server a custom name. This is optional.
    • SSH Key: If you want to log in without a password, add your SSH public key here. This is optional.

      Self-Managed VPS - Advanced Options
       

  8. Choose a billing term, check your Order Summary, then click Continue to Checkout.

    Self-Managed VPS - Initial Continue to Check Out
     

  9. Review your HostGator cart. Some add-ons may be included by default. Review each item, remove any you don't want, then click Continue to Checkout again.

    Self-Managed VPS - Continue to Checkout
     

  10. On the Checkout page, do the following:

    If you are new to HostGator:

    1. Fill in your billing information and contact details. If you don't want marketing emails, uncheck the box at the bottom.

      Self-Managed VPS - Billing Information
       

    2. Create a password for your account.

      Self-Managed VPS - Account Password
       

    3. Choose how you want to pay—credit card or PayPal—and enter your payment details.

      Self-Managed VPS - Payment Method Options
       

    If you already have an account, your HostGator login details will show up once you log in to your Customer Portal. If you are not logged in, click Log In.

    Self-Managed VPS - HostGator Login
     

  11. Review your payment method and order total. If you have a promo code, click Add Promo Code and enter your code. If you need to make changes, click Edit or Add Payment Method. When everything looks correct, click Submit Payment to complete your purchase. By clicking Submit Payment, you agree to the Auto Renewal Terms, Terms of Service, Cancellation Policy, and Privacy Notice.

    Self-Managed VPS - Submit Payment
     

After checkout, your Self-Managed VPS will begin setting up. Once it's ready, you can find it under the Hosting tab in your Customer Portal.

If you have questions about purchasing the Self-Managed VPS hosting, please contact us for assistance.

Opening Your OpenLiteSpeed + Node.js Dashboard

After the installation completes:

  1. Log in to your Customer Portal.
  2. From the left-hand menu, navigate to Hosting and select My Plans.

    Customer Portal - Hosting tab - View Details
     

  3. Locate the server you want to manage, then click View Details in the bottom-left corner to expand the section and access additional server information.

    Customer Portal - Hosting tab - View Details
     

  4. Click the Reset Password button.

    Customer Portal - Hosting tab - View Details - Reset Password
     

  5. In the pop-up window, type your new root password, then click Reset Password again to confirm and save the changes.

    Customer Portal - Hosting tab - View Details - Reset Password
     

  1. Connect to your VPS over SSH.
    Use an SSH client with your VPS IP address and login details, then respond to the prompts by entering your root password when asked:
    ssh root@your_server_ip
  2. Run this command to retrieve your password.
    grep OLS_ADMIN_PASS /root/.app_passwords
  3. Your dashboard password appears in the output.
    Sample:
    root@server-123456:~# grep OLS_ADMIN_PASS /root/.app_passwords
    OLS_ADMIN_PASS=exampleonly1ItjdBvI05SEP3m34AC
  4. Open the WebAdmin console. In your browser, go to http://your_server_ip:7080/, replacing your_server_ip with your server's IP address. (Sample: http://12.3.456.789:7080/)
  5. The dashboard login page opens.

    Openlite Dashboard Login Page
     

  6. Enter the username admin and the password you retrieved in step 8.
  7. Your dashboard then loads.

    Openlite Dashboard
     

More Details and Examples

Run cat /root/README.md for further details and handy commands:

Sample Output:

root@123456:~# cat /root/README.md
# OpenLiteSpeed + Node.js

## Description

OpenLiteSpeed and Node.js is a web server and runtime combination for deploying server-side JavaScript applications. OpenLiteSpeed handles traffic delivery while Node.js runs real-time, event-driven back-end logic, which suits APIs, web apps, and dynamic services.

## Image contents

* OpenLiteSpeed from the official LiteSpeed repository (`repo.litespeed.sh`)
* Node.js 22 LTS via NodeSource
* Placeholder Node.js application at `/var/www/html/nodejs/app.js`
* OLS virtual host configured to proxy all traffic -> Node.js port 3000
* `nodejs-app` systemd service to manage the Node.js process
* `openlitespeed` systemd service (depends on `nodejs-app`)
* UFW firewall: ports 22, 80, 7080 open
* Log rotation at `/etc/logrotate.d/openlitespeed-nodejs`
* Login banner at `/etc/update-motd.d/99_openlitespeed-nodejs`
* First-boot script at `/var/lib/cloud/scripts/per-instance/001_onboot`

## Services

Service         | Port | Description
--------------- | ---- | -----------------------------------------------
OpenLiteSpeed   | 80   | HTTP - proxies all traffic to Node.js on 3000
OLS WebAdmin    | 7080 | Web-based admin console (HTTP)
nodejs-app      | 3000 | Internal - proxied by OLS, not exposed directly
OpenSSH         | 22   | Remote access

## First boot behavior

`/var/lib/cloud/scripts/per-instance/001_onboot` runs once on first boot:

1. Generates a 24-character random WebAdmin password.
2. Stores it in `/root/.app_passwords` (mode 600).
3. Sets the password using the official OLS `admpass.sh` tool.
4. Starts `nodejs-app` and waits for port 3000.
5. Starts `openlitespeed`.

No credentials are included in the image; a unique password is generated for each instance on first boot.

## Accessing the UI

After first boot, open in a browser:

* **Node.js app:** `http://server-ip/`
* **OLS WebAdmin:** `http://server-ip:7080/`
  * Username: `admin`
  * Password: run `grep OLS_ADMIN_PASS /root/.app_passwords` on the server

## HTTPS / SSL

OpenLiteSpeed includes built-in Let's Encrypt support. To enable HTTPS:

1. Open the OLS WebAdmin console at `http://server-ip:7080/`
2. Navigate to **Listeners** and add an SSL listener on port 443.
3. Under the virtual host, use the built-in **Let's Encrypt** option to
   provision a certificate for your domain.

A valid domain name pointing to this server is required for Let's Encrypt.

## Deploying your Node.js application

Replace the placeholder with your own application:

```bash
# Upload your app files to /var/www/html/nodejs/
# Then restart:
systemctl restart nodejs-app
```

Your app must listen on `127.0.0.1:3000`. Use `process.env.PORT || 3000`.

## Useful commands

```bash
# Service status
systemctl status openlitespeed
systemctl status nodejs-app

# Restart services
systemctl restart nodejs-app
systemctl restart openlitespeed

# Logs
tail -100 /usr/local/lsws/logs/error.log
tail -100 /var/log/nodejs/app.log
journalctl -u openlitespeed -n 100 --no-pager
journalctl -u nodejs-app -n 100 --no-pager

# WebAdmin password
grep OLS_ADMIN_PASS /root/.app_passwords

# Reset WebAdmin password manually
/usr/local/lsws/admin/misc/admpass.sh
```

## Validation tests

```bash
perl /root/app_test/main.t
```

Runs 14 checks: services enabled and active, all config and service files
present, Node.js binary available, `admpass.sh` present, port 80 listening,
and end-to-end HTTP proxy response verified.

## Important paths

Path | Description
---- | -----------
`/usr/local/lsws/conf/httpd_config.conf` | OLS main server config
`/usr/local/lsws/conf/vhosts/nodejs/vhconf.conf` | OLS virtual host (proxy)
`/usr/local/lsws/logs/` | OLS server logs
`/usr/local/lsws/admin/conf/htpasswd` | WebAdmin credentials (hashed)
`/usr/local/lsws/admin/misc/admpass.sh` | OLS password reset tool
`/var/www/html/nodejs/app.js` | Node.js application entry point
`/var/log/nodejs/app.log` | Node.js application log
`/var/log/openlitespeed-nodejs/` | OLS service log
`/root/.app_passwords` | Plaintext WebAdmin password (mode 600)
`/etc/openlitespeed/openlitespeed.env` | OLS port/user reference file

## Links

* Manage: [OpenLiteSpeed WebAdmin](http://server-ip:7080/)

**OpenLiteSpeed**
* Home: [openlitespeed.org](https://openlitespeed.org/)
* Documentation: [docs.openlitespeed.org](https://docs.openlitespeed.org/)
* Installation guide: [Install from Repository](https://docs.openlitespeed.org/installation/repo/)
* Node.js app server setup: [App Server - Node.js](https://docs.openlitespeed.org/config/appserver/nodejs/)
* Reverse proxy configuration: [Reverse Proxy](https://docs.openlitespeed.org/config/reverseproxy/)
* Community forum: [forum.openlitespeed.org](https://forum.openlitespeed.org/)

**Node.js**
* Home: [nodejs.org](https://nodejs.org/)
* Node.js 22 LTS docs: [Previous Releases](https://nodejs.org/en/about/previous-releases)
* npm documentation: [docs.npmjs.com](https://docs.npmjs.com/)
* NodeSource distributions: [nodesource/distributions](https://github.com/nodesource/distributions)

Loading...