Skip to content

Deployment Overview of OpenLiteSpeed Node.js on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the following requirements must be met:

  • Operating System: Ubuntu (Debian-based).

  • Privileges: Root or sudo access is required for package installation and service management.

  • Ports:

  • 80/TCP: HTTP traffic and Certbot ACME challenges.

  • 443/TCP: HTTPS traffic.

  • 7080/TCP: OpenLiteSpeed WebAdmin internal port.

FQDN of the final panel on the hostkey.in domain

The application uses a specific domain template for accessing the web interface and managing SSL certificates via Certbot.

Parameter Value
Prefix openlitespeed-nodejs
Domain hostkey.in
Full template openlitespeed-nodejs{Server_ID}.hostkey.in

Application installation process

The installation follows a multi-step process involving package management and container orchestration:

  1. System Dependencies: The system is updated, and essential tools such as curl, wget, and gnupg are installed.

  2. OpenLiteSpeed Installation:

  3. The LiteSpeed repository is added to the system sources.

  4. The openlitespeed package is installed via the package manager.

  5. The lsws service is enabled and started.

  6. Node.js Installation:

  7. The NodeSource APT repository for Node.js 20.x is added to the system.

  8. The nodejs package is installed.

  9. WebAdmin Configuration: An initialization script (admpass.sh) is used to set the administrative credentials for the OpenLiteSpeed WebAdmin interface.

  10. Docker Environment Setup:

  11. Docker and containerd are installed from official repositories.

  12. A daemon.json configuration file is created to configure registry mirrors and storage drivers.

  13. Reverse Proxy Configuration: An Nginx container is deployed to handle SSL termination and proxy requests to the OpenLiteSpeed backend.

Access Rights and Security

  • Firewall: Ensure ports 80, 443, and 7080 are open in your system firewall.

  • WebAdmin Security: The OpenLiteSpeed WebAdmin interface is protected by credentials configured during installation.

  • SSL/TLS: SSL certificates are managed via Certbot within a Docker container to ensure automated renewals.

Docker Containers and Their Deployment

The deployment utilizes a Docker container to manage Nginx and SSL certificate lifecycle (Certbot).

Container Name Image Ports Volumes Environment Variables Restart Policy
nginx-nginx-1 jonasal/nginx-certbot:latest Host Network - nginx_secrets:/etc/letsencrypt
- /data/nginx/user_conf.d:/etc/nginx/user_conf.d
- /data/nginx/letsencrypt:/var/www/letsencrypt
[email protected] unless-stopped

Custom Scripts and Additional Setup

The following actions are performed to finalize the environment:

  • WebAdmin Credential Setup: The script /usr/local/lsws/admin/misc/admpass.sh is executed to set up the administrative user for OpenLiteSpeed.

  • Nginx Configuration Generation: A custom Nginx configuration file is generated in /data/nginx/user_conf.d/ to map the domain to the internal OpenLiteSpeed port (7080).

  • SSL Challenge Setup: A directory structure is created at /data/nginx/letsencrypt/.well-known/acme-challenge to facilitate Let's Encrypt validation.

Application Update Instructions

To update the main application components:

  • OpenLiteSpeed and Node.js: Use the standard system package manager updates:

    apt update && apt upgrade
    

  • Nginx Proxy Container: To pull the latest version of the proxy container, navigate to /root/nginx and run:

    docker compose pull && docker compose up -d
    

Location of configuration files and data

Component Path
Nginx Compose File /root/nginx/compose.yml
Nginx User Configs /data/nginx/user_conf.d/
Certbot Environment /data/nginx/nginx-certbot.env
Docker Configuration /etc/docker/daemon.json

Available ports for connection

  • HTTPS (Proxy): 443

  • HTTP (Redirect/Challenge): 80

  • OpenLiteSpeed WebAdmin: 7080

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×