OpenLiteSpeed is the open source edition of LiteSpeed Web Server. It is event driven, runs PHP through its fast LSAPI interface, reads Apache-style rewrite rules from .htaccess and includes a built-in page cache (LSCache). It is configured from a web console called WebAdmin. In this tutorial you will install OpenLiteSpeed and PHP 8.3 on Ubuntu 24.04 from the LiteSpeed repository, serve a site on port 80 with its own virtual host, and secure it with a Let's Encrypt certificate.
Prerequisites
To follow this guide you need:
- A server running Ubuntu 24.04 LTS, for example a CubePath VPS, with at least 1 GB of RAM.
- A non-root user with
sudoprivileges and UFW enabled with SSH allowed. - No other web server listening on ports 80 or 443. If Apache or Nginx is installed, stop and disable it first.
- A domain name,
your_domainin this guide, with A records foryour_domainandwww.your_domainpointing toyour_server_ip.
Step 1 - Adding the LiteSpeed repository
OpenLiteSpeed and its PHP builds (LSPHP) are distributed from LiteSpeed's own apt repository. The vendor provides a small script that detects your distribution, installs the repository signing keys and writes the source list. Download it and review it before running it:
curl -fsSL -o litespeed-repo.sh https://repo.litespeed.sh
less litespeed-repo.sh
Run it:
sudo bash litespeed-repo.sh
Check that the repository was added and that apt can see the package:
cat /etc/apt/sources.list.d/lst_debian_repo.list
apt-cache policy openlitespeed
deb http://rpms.litespeedtech.com/debian/ noble main
#deb http://rpms.litespeedtech.com/edge/debian/ noble main
openlitespeed:
Installed: (none)
Candidate: 1.9.2-1+noble
The repository uses plain HTTP, but apt verifies every package with the LiteSpeed signing keys the script installed.
Step 2 - Installing OpenLiteSpeed and PHP
The openlitespeed package depends on LSPHP 8.3 (lsphp83, lsphp83-common and lsphp83-mysql), which becomes the default PHP handler. Install it together with a few extensions most PHP applications need:
sudo apt update
sudo apt install openlitespeed lsphp83-curl lsphp83-intl
Everything is installed under /usr/local/lsws. During installation the package prints a random password for the WebAdmin console:
WebAdmin user/password is admin/Xk3v9QpL2mRt7bYz
The service is enabled and started automatically. The systemd unit is lshttpd, with lsws as an alias. Check it:
sudo systemctl status lsws --no-pager
● lshttpd.service - OpenLiteSpeed HTTP Server
Loaded: loaded (/etc/systemd/system/lshttpd.service; enabled; preset: enabled)
Active: active (running) since Thu 2026-09-25 13:40:12 UTC; 30s ago
Out of the box, OpenLiteSpeed serves an example site on port 8088 and WebAdmin on port 7080. Confirm the example site answers locally:
curl -sI http://localhost:8088 | head -n 3
HTTP/1.1 200 OK
etag: "5ab-68d4c2a1-2c1b"
content-type: text/html
Step 3 - Configuring the firewall
Open HTTP and HTTPS for your sites, and open the WebAdmin port only to the IP you administer the server from. Replace your_admin_ip with that address:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow from your_admin_ip to any port 7080 proto tcp
Port 8088 stays closed; you will not need the example site.
sudo ufw status
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
7080/tcp ALLOW your_admin_ip
Step 4 - Setting the WebAdmin password
If you did not save the password shown during installation, it is also stored in a root-only file:
sudo cat /usr/local/lsws/adminpasswd
Replace it with your own password using the bundled script. It asks for a user name (press Enter to keep admin) and the new password twice:
sudo /usr/local/lsws/admin/misc/admpass.sh
Then delete the file with the old random password:
sudo rm /usr/local/lsws/adminpasswd
Open https://your_server_ip:7080 and log in as admin. WebAdmin uses a self-signed certificate, so accept the browser warning.
Step 5 - Creating the document root
Create a directory for the site and a small PHP file to test the setup. OpenLiteSpeed runs PHP as the nobody user by default, so the files must be readable by others:
sudo mkdir -p /var/www/your_domain/html
sudo chown -R "$USER":"$USER" /var/www/your_domain
Create a test page:
nano /var/www/your_domain/html/index.php
<?php
echo "Hello from OpenLiteSpeed, PHP " . PHP_VERSION;
The default permissions (755 for directories, 644 for files) are enough to serve the site. If your application must write files, such as an uploads directory, give write access only to that directory.
Step 6 - Creating the virtual host in WebAdmin
A virtual host tells OpenLiteSpeed where the site lives and how to run it. In WebAdmin, go to Virtual Hosts and click Add (the + icon). Fill in:
| Field | Value |
|---|---|
| Virtual Host Name | your_domain |
| Virtual Host Root | /var/www/your_domain/ |
| Config File | $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf |
| Follow Symbolic Link | Yes |
| Enable Scripts/ExtApps | Yes |
| Restrained | Yes |
Save. WebAdmin reports that the config file does not exist; click CLICK TO CREATE, then save again.
Open the new virtual host and configure it:
- General tab: set Document Root to
$VH_ROOT/html/. In Index Files, set Use Server Index Files toNoand Index Files toindex.php, index.html. Save. - Rewrite tab: in Rewrite Control, set Enable Rewrite to
Yesand Auto Load from .htaccess toYes. Save. Applications such as WordPress or Laravel ship their rewrite rules in.htaccess, and this lets OpenLiteSpeed read them.
PHP works without further settings: the server-level script handler sends .php files to the lsphp external application, which points to lsphp83/bin/lsphp.
Step 7 - Adding a listener on port 80
Listeners bind OpenLiteSpeed to an IP and port and map incoming host names to virtual hosts. Go to Listeners, click Add and set:
| Field | Value |
|---|---|
| Listener Name | HTTP |
| IP Address | ANY IPv4 |
| Port | 80 |
| Secure | No |
Save, open the new listener, and in Virtual Host Mappings click Add. Select the virtual host your_domain and enter your_domain, www.your_domain as Domains. Save.
Apply the changes with a graceful restart, either with the restart icon at the top right of WebAdmin or from the shell:
sudo /usr/local/lsws/bin/lswsctrl restart
Test the site:
curl -i http://your_domain
HTTP/1.1 200 OK
content-type: text/html; charset=UTF-8
server: LiteSpeed
Hello from OpenLiteSpeed, PHP 8.3.33
The response comes from PHP 8.3 through LSAPI and includes the server: LiteSpeed header.
Step 8 - Enabling HTTPS with Let's Encrypt
Install Certbot and request a certificate with the webroot method, which places the validation file in your document root and works while OpenLiteSpeed keeps running:
sudo apt install certbot
sudo certbot certonly --webroot -w /var/www/your_domain/html -d your_domain -d www.your_domain
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/your_domain/fullchain.pem
Key is saved at: /etc/letsencrypt/live/your_domain/privkey.pem
Now add an HTTPS listener in WebAdmin. Go to Listeners > Add:
| Field | Value |
|---|---|
| Listener Name | HTTPS |
| IP Address | ANY IPv4 |
| Port | 443 |
| Secure | Yes |
Save, then open the HTTPS listener:
- General tab, Virtual Host Mappings: add
your_domainwith domainsyour_domain, www.your_domain. - SSL tab, SSL Private Key & Certificate: set Private Key File to
/etc/letsencrypt/live/your_domain/privkey.pem, Certificate File to/etc/letsencrypt/live/your_domain/fullchain.pemand Chained Certificate toYes.
To redirect all HTTP traffic to HTTPS, open the virtual host, go to the Rewrite tab and add these Rewrite Rules:
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Restart gracefully and test both schemes:
sudo /usr/local/lsws/bin/lswsctrl restart
curl -sI http://your_domain | head -n 2
curl -sI https://your_domain | head -n 1
HTTP/1.1 301 Moved Permanently
location: https://your_domain/
HTTP/2 200
OpenLiteSpeed only loads certificates at startup, so it must be restarted after every renewal. Create a Certbot deploy hook:
sudo nano /etc/letsencrypt/renewal-hooks/deploy/openlitespeed.sh
#!/usr/bin/env bash
set -euo pipefail
/usr/local/lsws/bin/lswsctrl restart
Make it executable and test renewal:
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/openlitespeed.sh
sudo certbot renew --dry-run
Step 9 - Adjusting PHP settings
LSPHP has its own php.ini, separate from any system PHP. The package creates it from the production template in the LSPHP directory:
ls -l /usr/local/lsws/lsphp83/etc/php/8.3/litespeed/php.ini
-rw-r--r-- 1 root root 73012 Sep 25 13:39 /usr/local/lsws/lsphp83/etc/php/8.3/litespeed/php.ini
Edit it to raise common limits, for example for uploads:
sudo nano /usr/local/lsws/lsphp83/etc/php/8.3/litespeed/php.ini
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 60
LSPHP processes read php.ini when they start, so restart OpenLiteSpeed to apply the changes:
sudo /usr/local/lsws/bin/lswsctrl restart
Step 10 - Using LSCache
The cache module is enabled at server level in the default configuration, but it only stores pages when the application tells it to. For WordPress, install the LiteSpeed Cache plugin, which sends the right cache headers and purges pages when content changes. For other applications, LiteSpeed publishes LSCache plugins for platforms such as Drupal, Joomla and Laravel. Check that a page is served from cache by looking for the x-litespeed-cache: hit header on a second request:
curl -sI https://your_domain | grep -i x-litespeed-cache
Troubleshooting
- Port 80 already in use after installation: another web server is running. Stop it with
sudo systemctl disable --now apache2(ornginx) and restart OpenLiteSpeed. - 404 on every page: the listener has no mapping for the host name you requested. Check Virtual Host Mappings in the listener and include both
your_domainandwww.your_domain. - PHP code is downloaded instead of executed: Enable Scripts/ExtApps is set to
Noon the virtual host. Change it, then restart. - Configuration changes have no effect: WebAdmin saves the files but does not apply them. Perform a graceful restart after each change. Errors are logged in
/usr/local/lsws/logs/error.log.
Conclusion
You installed OpenLiteSpeed with PHP 8.3 on Ubuntu 24.04, created a virtual host served on ports 80 and 443 with a Let's Encrypt certificate and automatic renewal, and learned where to tune PHP. From here you can install MariaDB and deploy WordPress with the LiteSpeed Cache plugin, add more virtual hosts by repeating Steps 5 to 7, and review the access logs in /usr/local/lsws/logs/ to confirm traffic reaches the right site.
