OpenLiteSpeed (OLS) is free and has the same server-level page cache, LSCache, as LiteSpeed Enterprise. Paired with the LiteSpeed Cache plugin, it serves cached WordPress pages straight from the web server without starting PHP at all. This guide builds a WordPress site on OpenLiteSpeed with LSCache on a self-managed VPS.
Before you start
- An Ubuntu or AlmaLinux VPS with at least 1 GB RAM and root access.
- A domain pointing to the server; ports 80, 443 (TCP and UDP) open; 7080 open only to your IP.
- OpenLiteSpeed installed from the official repository: install OpenLiteSpeed.
- Prefer zero server admin? MdmHost cPanel hosting already runs LiteSpeed Enterprise with LSCache, so you only install the plugin.
Install PHP (lsphp) and extensions
OLS runs PHP through LSAPI using lsphp packages from the LiteSpeed repository. On Ubuntu:
sudo apt install -y lsphp83 lsphp83-common lsphp83-mysql lsphp83-curl lsphp83-intl lsphp83-imagick lsphp83-opcache lsphp83-redisOn AlmaLinux use dnf install with the same package names. Package names follow the PHP version (lsphp82, lsphp83 …). Background: LSAPI explained.
In WebAdmin → Server Configuration → External App, make sure the default lsphp entry points to /usr/local/lsws/lsphp83/bin/lsphp.
Install the database
sudo apt install -y mariadb-server
sudo mysql_secure_installation
sudo mysql -e "CREATE DATABASE wp; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'CHANGE_ME_STRONG'; GRANT ALL ON wp.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES;"Download WordPress
sudo mkdir -p /var/www/example.com/{html,logs}
cd /tmp && curl -O https://wordpress.org/latest.tar.gz
sudo tar xzf latest.tar.gz -C /var/www/example.com/html --strip-components=1
sudo chown -R nobody:nogroup /var/www/example.comOn AlmaLinux use nobody:nobody.
Create the virtual host
Follow OpenLiteSpeed WebAdmin: virtual hosts and listeners to:
- Add a vhost with root
/var/www/example.com/and document root$VH_ROOT/html/. - Set index files to
index.php, index.html. - Under Rewrite, enable rewrite and "Auto Load from .htaccess" so WordPress permalinks and LSCache rules work.
- Map the vhost to the port 80 and 443 listeners and add the SSL certificate.
- Graceful restart.
Enable the server cache module
- WebAdmin → Server Configuration → Modules. The
cachemodule should be listed; if not, add it. - In the vhost → Modules, add
cacheif you want per-site settings; otherwise server defaults apply. - Leave "Enable Cache" off at server level: the WordPress plugin turns caching on for the site through .htaccess rules, so it can also purge correctly.
- Graceful restart.
Finish the WordPress install
Open https://example.com, run the installer with the database details above, then go to Settings → Permalinks and save once.
Install and configure LiteSpeed Cache
- Plugins → Add New, search "LiteSpeed Cache", install and activate.
- LiteSpeed Cache → Cache: enable cache; leave logged-in user caching off unless you understand private cache.
- The plugin writes its rules to
.htaccess. Because OLS reads .htaccess only at startup, do a graceful restart after first enabling the plugin and after changes that edit .htaccess. - Optional: enable object cache with Redis, and image optimisation via QUIC.cloud.
Plugin settings in detail: LiteSpeed Cache plugin for WordPress.
Verify cache hits
curl -sI https://example.com/ | grep -i x-litespeed-cache
curl -sI https://example.com/ | grep -i x-litespeed-cacheThe first request shows miss, the next hit. Log out of WordPress or use a private window when testing in a browser; logged-in users bypass the public cache.
Troubleshooting
- No X-LiteSpeed-Cache header: cache module not loaded, or no graceful restart after the plugin added its rules.
- Permalinks 404: rewrite not enabled in the vhost, or .htaccess not reloaded.
- "Your PHP installation appears to be missing the MySQL extension": install
lsphpXX-mysqlfor the version the vhost uses. - Upload size limited to 2 MB: edit
/usr/local/lsws/lsphp83/etc/php/8.3/litespeed/php.ini(path varies by OS) and restart.
FAQ: WordPress on OpenLiteSpeed
Is OpenLiteSpeed good for WooCommerce?
Yes. LSCache handles cart and checkout exclusions through the plugin.
Do I need Nginx or Varnish as well?
No. LSCache replaces them.
OpenLiteSpeed or LiteSpeed Enterprise for WordPress?
For one site on a VPS, OLS is great. For many users or cPanel, Enterprise: Enterprise vs OpenLiteSpeed.
