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:
-
System Dependencies: The system is updated, and essential tools such as
curl,wget, andgnupgare installed. -
OpenLiteSpeed Installation:
-
The LiteSpeed repository is added to the system sources.
-
The
openlitespeedpackage is installed via the package manager. -
The
lswsservice is enabled and started. -
Node.js Installation:
-
The NodeSource APT repository for Node.js 20.x is added to the system.
-
The
nodejspackage is installed. -
WebAdmin Configuration: An initialization script (
admpass.sh) is used to set the administrative credentials for the OpenLiteSpeed WebAdmin interface. -
Docker Environment Setup:
-
Docker and containerd are installed from official repositories.
-
A
daemon.jsonconfiguration file is created to configure registry mirrors and storage drivers. -
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.shis 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-challengeto 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:
-
Nginx Proxy Container: To pull the latest version of the proxy container, navigate to
/root/nginxand run:
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