OpenLiteSpeed is the free, open-source edition of the LiteSpeed web server. It is event-driven, runs PHP through the fast LSAPI interface and works with the LSCache plugins for WordPress and other apps. This guide installs OpenLiteSpeed on a self-managed VPS and sets up your first site.
Before you start
- A clean Ubuntu 22.04/24.04 or AlmaLinux/Rocky 8/9 VPS with root access. Do not install it next to Apache or Nginx on ports 80/443.
- A domain pointing to the server.
- Firewall access to ports 80, 443 and 7080 (WebAdmin – restrict this to your own IP if you can).
Note: On MdmHost cPanel hosting you already run LiteSpeed Enterprise, so you do not need OpenLiteSpeed. This guide is for your own VPS.
Add the LiteSpeed repository
- Run the official repository script as root:
wget -O - https://repo.litespeed.sh | sudo bash
Install OpenLiteSpeed and PHP
- On Ubuntu:
sudo apt install -y openlitespeed lsphp83 lsphp83-common lsphp83-mysql lsphp83-curl lsphp83-intl lsphp83-opcache - On AlmaLinux/Rocky:
sudo dnf install -y openlitespeed lsphp83 lsphp83-common lsphp83-mysqlnd lsphp83-intl lsphp83-opcache - Start the service:
sudo systemctl enable --now lsws
Use a newer PHP package name (for example lsphp84) if your application supports it.
Set the WebAdmin password
- Run the admin password script:
sudo /usr/local/lsws/admin/misc/admpass.sh - Open
https://your-server-ip:7080, accept the self-signed certificate warning and log in.
Point the server at your PHP version
- In WebAdmin go to Server Configuration → External App and edit the LSAPI app.
- Set Command to
lsphp83/bin/lsphp(matching the version you installed) and save.
Create a virtual host
- Create the document root:
sudo mkdir -p /var/www/example.com/html. - In WebAdmin go to Virtual Hosts → Add. Set name
example.com, Virtual Host Root/var/www/example.com/, Config File$SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf, and enable scripts. Save and let it create the config file. - Open the new host, go to General and set Document Root to
$VH_ROOT/html/. - Under Rewrite, enable rewrites and set Auto Load from .htaccess to Yes.
- Go to Listeners, open the Default listener (port 80) and add a mapping from the virtual host to
example.com, www.example.com. - Click Graceful Restart at the top right.
Add HTTPS
- Get a certificate with Certbot in webroot mode:
sudo certbot certonly --webroot -w /var/www/example.com/html -d example.com -d www.example.com. - Add a listener on port 443 with Secure set to Yes, point the private key and certificate to the files under
/etc/letsencrypt/live/example.com/, map your virtual host and graceful restart.
Troubleshooting
- Can't open port 7080: open it in the firewall, or reach it through an SSH tunnel.
- .htaccess changes ignored: OpenLiteSpeed reads rewrite rules on restart; do a graceful restart after editing.
- PHP shows as text or 503: the External App command path does not match an installed lsphp version.
- Logs: check
/usr/local/lsws/logs/error.log.
FAQ: OpenLiteSpeed
What is the difference between OpenLiteSpeed and LiteSpeed Enterprise?
Enterprise is paid, reads .htaccess live and integrates with cPanel, Plesk and DirectAdmin. OpenLiteSpeed is free, uses its own WebAdmin and reads rewrite rules only on restart.
Does LSCache work on OpenLiteSpeed?
Yes, the LSCache module is included and works with the LiteSpeed Cache plugin for WordPress.
Can I use OpenLiteSpeed with a control panel?
Some panels such as CyberPanel are built around it, but cPanel requires Apache or LiteSpeed Enterprise.
