OpenLiteSpeed is a free, open-source, high-performance web server with HTTP/2 and HTTP/3 support, native PHP handling, and a graphical admin console for managing virtual hosts. This guide installs it on Ubuntu 22.04, creates a virtual host with a custom web root, and secures it with a real TLS certificate.
Prerequisites: an Ubuntu 22.04 instance, non-root sudo user, a domain A record (e.g.
app.example.com).
Install OpenLiteSpeed
Not in the default repos — use the official setup script:
$ wget -O openlitespeed.sh https://repo.litespeed.sh
$ sudo bash openlitespeed.sh
$ sudo apt install openlitespeed -y
$ cat /usr/local/lsws/VERSION
Manage the Service
Runs as lshttpd.service, aliased to lsws:
$ sudo systemctl enable lshttpd.service
$ sudo systemctl start lsws
$ sudo systemctl status lsws
Stop/restart with sudo systemctl stop lsws / restart lsws.
Access the Admin Console
Runs on port 7080; default password lives at /usr/local/lsws/admin/password.
$ sudo bash /usr/local/lsws/admin/misc/admpass.sh
Set a custom admin username and password when prompted, then open the port:
$ sudo ufw allow 7080/tcp
$ sudo ufw reload
Visit http://SERVER-IP:7080, accept the self-signed cert warning, log in with the credentials you just set.
Move the default listener off 8088 onto standard HTTP:
- Listeners → view the Default listener → Edit on Address Settings.
- Change Port from
8088to80→ Save. - Graceful Restart (top right, next to LSWS PID) → Go.
Create a Virtual Host
$ sudo mkdir /usr/local/lsws/app.example.com
$ sudo mkdir /usr/local/lsws/app.example.com/{html,logs,conf} -p
$ sudo chown lsadm:lsadm -R /usr/local/lsws/app.example.com/
-
html— served application files -
logs— access/error logs -
conf— site-specific config
In the console:
-
Virtual Hosts → Add, replacing
app.example.comwith your domain:-
Virtual Host Name:
app.example.com -
Virtual Host Root:
$SERVER_ROOT/app.example.com/ -
Config File:
$SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf -
Follow Symbolic Link, Enable Scripts/ExtApps, Restrained:
Yes -
External App Set UID Mode:
Server UID
-
Virtual Host Name:
- Save → CLICK TO CREATE on the config-file-missing prompt → Save again.
- Open the new virtual host → General → Edit:
-
Document Root:
$VH_ROOT/html/ -
Domain Name:
app.example.com -
Enable GZIP Compression, Enable Brotli Compression:
Yes
-
Document Root:
-
Log → Edit (error log):
Use Server's Log: Yes, File Name:$VH_ROOT/logs/error.log, Log Level:ERROR, Rolling Size:10M, Keep Days:30. -
Log → Add (access log): Log Control:
Own Log File, File Name:$VH_ROOT/logs/access.log, same rolling/retention values. -
Rewrite → Edit: Enable Rewrite:
Yes, Auto Load from.htaccess:Yes. -
Listeners → Default Listener → Virtual Host Mappings → Add: select your virtual host, enter
app.example.comin Domains. - Save, then Graceful Restart → Go.
Add a test page:
$ sudo nano /usr/local/lsws/app.example.com/html/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>OpenLiteSpeed Server Install Test</title>
</head>
<body>
<h1 style="text-align: center;">It works!</h1>
</body>
</html>
$ sudo ufw allow 80/tcp
Visit http://app.example.com and confirm the page loads.
Secure with Let's Encrypt
$ sudo snap install --classic certbot
$ sudo certbot certonly --webroot -w /usr/local/lsws/app.example.com/html/ --agree-tos --no-eff-email --staple-ocsp --preferred-challenges http -m name@example.com -d app.example.com
$ sudo certbot renew --dry-run
Certbot doesn't have an OpenLiteSpeed plugin — wire the certificate in manually via the console:
-
Listeners → Add: Listener Name:
HTTPS, IP Address:ANY IPv4, Port:443, Secure:Yes→ Save. - Open the new HTTPS listener → Virtual Host Mappings → Add: Virtual Host:
app.example.com, Domains:app.example.com. -
SSL → Edit:
-
Private Key File:
/etc/letsencrypt/live/app.example.com/privkey.pem -
Certificate File:
/etc/letsencrypt/live/app.example.com/fullchain.pem -
Chained Certificate:
Yes
-
Private Key File:
- Save, then Graceful Restart → Go.
For multiple virtual hosts, open each one's SSL tab individually to bind a certificate.
Firewall Rules
$ sudo ufw allow 22/tcp && sudo ufw enable
$ sudo ufw allow 7080/tcp
$ sudo ufw allow http
$ sudo ufw allow https
$ sudo ufw reload
$ sudo ufw status
Visit https://app.example.com to confirm TLS is working end to end.
Next Steps
OpenLiteSpeed is running with a virtual host, HTTPS, and a working test page. From here:
- Add PHP via the console's Server Configuration → External App for dynamic sites
- Repeat the virtual host steps per additional domain you host on the same server
- Automate cert renewal hooks to reload the listener after Certbot rotates the certificate
For the full guide, visit the original article on Vultr Docs.
Top comments (0)