Log inSign up

OpenLiteSpeed setup: repository, WebAdmin, PHP and TLS

Add the official LiteSpeed repository with its setup script, then install the openlitespeed package with apt or dnf. Set an admin password with admpass.sh, open the WebAdmin panel on port 7080 through an SSH tunnel, move the listener to port 80, and add a 443 listener with a Certbot certificate. The result is an event-driven server that reads Apache-style rewrite rules and runs PHP through LSPHP.

Topic: Web servers and proxies · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13, Rocky Linux 9, AlmaLinux 9 · Updated 2026-12-03

What is OpenLiteSpeed and when does it fit?

OpenLiteSpeed is the open source edition of the LiteSpeed web server. It handles connections with an event loop like Nginx, understands most Apache .htaccess rewrite rules, and talks to PHP through its own LSAPI interface. Its built-in page cache pairs with the LSCache plugins for WordPress and other PHP applications, which is the main reason people choose it.

Configuration happens mostly in a web panel called WebAdmin rather than in text files you edit by hand. That suits people who prefer forms, and it is also why securing the panel is the first job after installing. If you would rather keep everything in plain config files, the Nginx guide or the Apache guide may fit better.

How do you prepare the server?

Start with a fresh Ubuntu 24.04, Debian 12 or 13, Rocky Linux 9 or AlmaLinux 9 server, a sudo user, and a domain pointing at the server. Make sure nothing else listens on ports 80 and 443; OpenLiteSpeed cannot share them with Nginx or Apache.

sudo ss -ltnp | grep -E ':80 |:443 '
# stop and disable a previous web server if one shows up
sudo systemctl disable --now apache2 nginx 2>/dev/null

If you are not sure how to reach the server yet, follow your first SSH session and then SSH keys and hardening before installing anything that exposes a web panel.

How do you install OpenLiteSpeed?

LiteSpeed publishes a small script that adds its package repository and signing key for both apt and dnf systems. Download it, read it, then run it:

curl -fsSL https://repo.litespeed.sh -o litespeed-repo.sh
less litespeed-repo.sh
sudo bash litespeed-repo.sh

Install the server package. On Ubuntu and Debian:

sudo apt update
sudo apt install -y openlitespeed

On Rocky and Alma:

sudo dnf install -y openlitespeed

Everything lands under /usr/local/lsws. The service is called lsws; confirm it is running and print the installed release:

sudo systemctl enable --now lsws
systemctl status lsws --no-pager
cat /usr/local/lsws/VERSION

Out of the box a demo site listens on port 8088 and WebAdmin on port 7080.

How do you secure and open the WebAdmin panel?

Set your own admin login first, then reach the panel through an SSH tunnel instead of opening port 7080 to the internet.

sudo /usr/local/lsws/admin/misc/admpass.sh

The script asks for a user name and a strong password. Next, from your own computer, forward the port over SSH:

ssh -L 7080:127.0.0.1:7080 deploy@198.51.100.24

While that session stays open, browse to https://localhost:7080. The panel uses a self-signed certificate, so the browser warns once; accept it for this local address only. Because the panel is never exposed publicly, your firewall only needs SSH, HTTP and HTTPS:

# Ubuntu and Debian
sudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw enable

# Rocky and Alma
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --reload

How do you add PHP with LSPHP?

OpenLiteSpeed runs PHP through LSPHP packages from the same repository. Install a current branch plus the extensions your app needs. Package names follow the pattern lsphp83, lsphp83-mysql and so on:

# Ubuntu and Debian
sudo apt install -y lsphp83 lsphp83-common lsphp83-mysql lsphp83-curl lsphp83-intl

# Rocky and Alma
sudo dnf install -y lsphp83 lsphp83-common lsphp83-mysqlnd lsphp83-process lsphp83-intl

/usr/local/lsws/lsphp83/bin/php -v

Run apt search lsphp or dnf search lsphp to see which branches the repository offers today. In WebAdmin, open Server Configuration, then External App, and point the LSAPI app at /usr/local/lsws/lsphp83/bin/lsphp. Then under Script Handler make sure the php suffix uses that app. Save and click the graceful restart button.

How do you serve your domain on port 80?

Create a document root, define a virtual host for it, and map the domain to that host on a listener bound to port 80.

sudo mkdir -p /var/www/example.net/public
echo '<?php echo "OpenLiteSpeed and PHP are working";' | sudo tee /var/www/example.net/public/index.php
sudo chown -R nobody:nogroup /var/www/example.net   # nobody:nobody on Rocky and Alma

In WebAdmin:

  1. Virtual Hosts, add: name example.net, root /var/www/example.net, config file $SERVER_ROOT/conf/vhosts/example.net/vhconf.conf. Allow it to create the file.
  2. Inside the new host, General tab: document root $VH_ROOT/public/, index files index.php, index.html.
  3. Rewrite tab: enable rewrite and set Auto Load from .htaccess to Yes if your app ships rules.
  4. Listeners: edit the Default listener, change the port from 8088 to 80, and add a mapping from example.net, www.example.net to the new virtual host.

Graceful restart, then test with curl -i http://example.net/.

How do you add HTTPS with Certbot?

Use Certbot in webroot mode, because there is no OpenLiteSpeed plugin. Certbot writes a token into your document root and the running server delivers it.

# Ubuntu and Debian
sudo apt install -y certbot
# Rocky and Alma
sudo dnf install -y epel-release && sudo dnf install -y certbot

sudo certbot certonly --webroot -w /var/www/example.net/public \
  -d example.net -d www.example.net \
  --deploy-hook "systemctl restart lsws"

Then in WebAdmin add a listener named SSL on port 443 with Secure set to Yes. On its SSL tab, set the private key to /etc/letsencrypt/live/example.net/privkey.pem and the certificate to /etc/letsencrypt/live/example.net/fullchain.pem, and add the same domain mapping. The deploy hook is stored with the certificate, so every renewal restarts the server to load the new files. Prove it with sudo certbot renew --dry-run. To push all visitors to HTTPS, follow HTTPS and www redirects.

Where are the logs and how do you troubleshoot?

Server-wide logs are in /usr/local/lsws/logs/: error.log for problems and access.log for requests. Watch them while you reproduce an issue:

sudo tail -f /usr/local/lsws/logs/error.log
sudo /usr/local/lsws/bin/lswsctrl status
sudo journalctl -u lsws -n 50
  • Changes do nothing: WebAdmin edits only apply after a graceful restart, or sudo /usr/local/lsws/bin/lswsctrl restart.
  • 503 errors on PHP pages: the LSPHP path in External App is wrong or the package is missing.
  • Domain shows the demo site: the listener mapping does not include that host name.
  • Locked out of WebAdmin: run admpass.sh again.

Updates for the server and LSPHP arrive with normal apt or dnf upgrades because they come from a regular repository.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-2one small PHP site1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4WordPress with LSCache and a local database2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about OpenLiteSpeed web server

Is OpenLiteSpeed free?

Yes, OpenLiteSpeed is open source under the GPLv3. The commercial LiteSpeed Enterprise edition is a separate product with full Apache configuration compatibility.

Does it read my .htaccess files?

It reads rewrite rules from .htaccess when you enable that option, but it does not reread them on every request. Restart gracefully after changing them.

Should I open port 7080 in the firewall?

Avoid it. An SSH tunnel gives you the panel without exposing a login page to scanners. If you must open it, limit it to your own address.

Where is the main configuration file?

Server settings live in /usr/local/lsws/conf/httpd_config.conf, and each virtual host has its own file under /usr/local/lsws/conf/vhosts/. WebAdmin edits these files.

Can I run WordPress on it?

Yes. Install LSPHP with the MySQL extension, a database server, and the LSCache plugin inside WordPress to use the built-in page cache.

How do I uninstall it?

Stop the service, then remove the openlitespeed and lsphp* packages with apt or dnf. Delete /usr/local/lsws afterwards if you no longer need its config and logs.