A fast WordPress on OpenLiteSpeed: what to set up and in which order
5 min read
OpenLiteSpeed with LSPHP and the LiteSpeed Cache plugin serves cached WordPress pages without starting PHP. The setup step by step, the three things that break it on a fresh install, how to check that the cache works, and what not to switch on.
OpenLiteSpeed is fast for WordPress for one main reason: its page cache is part of the web server. With the LiteSpeed Cache plugin, a cached page is answered by the server itself, and PHP and MySQL are never started. Everything else (LSPHP, HTTP/3, compression) helps, but the cache is the large step.
We built this setup on a fresh Ubuntu 26.04.1 system on 12 November 2026: OpenLiteSpeed 1.9.4 and LSPHP 8.5.12 from LiteSpeed's repository, WordPress and the LiteSpeed Cache plugin.
In short
- Install OpenLiteSpeed and
lsphp85from LiteSpeed's repository. PHP 8.2 to 8.5 are packaged for Ubuntu 26.04. - A fresh OpenLiteSpeed runs PHP 8.3 by default and ignores
.htaccess. Change both. - Install the LiteSpeed Cache plugin and turn the cache on.
- Check the response header:
x-litespeed-cache: hitmeans the page came from the cache. - Add an object cache only when the site has logged-in users or a shop. Leave most of the plugin's optimisation switches off at first.
1. Install the server and PHP
wget -O - https://repo.litespeed.sh | sudo bash
sudo apt-get install openlitespeed lsphp85 lsphp85-common lsphp85-mysql lsphp85-curl
On Ubuntu 26.04 the repository has lsphp82, lsphp83, lsphp84 and lsphp85.
One package you will not find is lsphp85-opcache. From PHP 8.5, OPcache is always built in:
/usr/local/lsws/lsphp85/bin/php -m | grep -i opcache
Zend OPcache
2. Three things to fix on a fresh install
A new OpenLiteSpeed serves its example site. Three defaults stand between it and a working WordPress.
The PHP version. Installing lsphp85 does not make the server use it. In /usr/local/lsws/conf/httpd_config.conf the PHP handler still pointed to 8.3 on our system:
extProcessor lsphp{
path lsphp83/bin/lsphp
Change the path to lsphp85/bin/lsphp.
.htaccess is ignored. WordPress permalinks and the cache plugin both write rules into .htaccess. In the virtual host configuration, rewriting is off:
rewrite {
enable 0
}
Set:
rewrite {
enable 1
autoLoadHtaccess 1
}
index.php is not an index file. The example virtual host has indexFiles index.html. With that, the home page of a WordPress site answers 404. Set indexFiles index.php, index.html.
Restart after the changes:
sudo /usr/local/lsws/bin/lswsctrl restart
3. Install the cache plugin
In the WordPress admin: Plugins → Add New → LiteSpeed Cache. Or with WP-CLI:
wp plugin install litespeed-cache --activate
wp litespeed-option set cache 1
The plugin writes its rules into .htaccess:
# BEGIN LSCACHE
<IfModule LiteSpeed>
CacheLookup on
...
CacheLookup on is the line that lets the server answer from the cache before PHP starts. This is why step 2 matters: if .htaccess is not read, the plugin looks active and nothing is cached.
4. Check that it works
curl -sI https://example.com/ | grep -i x-litespeed-cache
The first request builds the page (miss). The second one, on our system:
x-litespeed-cache: hit
No such header at all means the cache is not active. Go back to step 2.
Pages that must not be cached are left out by the plugin itself: the admin area, logged-in users, and the cart and checkout of WooCommerce.
5. What to switch on, and what to leave
The plugin has many tabs. A sensible order:
- Cache: on. Keep the default lifetimes.
- Purge: leave "purge on update" on, so that an edited post is fresh at once.
- Browser cache: on.
- Image optimisation and lazy loading: on, test your pages.
- CSS and JavaScript minify and combine: one switch at a time, with a look at the site after each. These are the settings that break layouts and sliders.
If a page looks wrong after a change, switch that one option off and purge the cache. Do not turn everything on at once; you will not know which switch did it.
6. Object cache
The page cache helps visitors who are not logged in. Logged-in users, shop customers and the admin area get fresh pages, and for them the database is the slow part.
An object cache (Redis or Valkey, or Memcached) keeps the results of database queries in memory. Install the server and the PHP extension, then turn it on in the plugin under Cache → Object.
It is worth it for WooCommerce, membership sites and busy admin areas. For a blog that is read by anonymous visitors, the page cache already does the work.
7. The rest
- PHP workers. With the page cache working, PHP is used much less. Size the number of LSPHP processes for the uncached share of traffic, not for all of it.
- The database. Give MariaDB enough
innodb_buffer_pool_sizefor your data, and clean up old revisions and expired transients now and then. - Plugins. Each active plugin adds work to every uncached request. Remove what you do not use.
- Updates. Update
openlitespeedand the LSPHP packages together with the system.
With Zefily
Zefily installs WordPress on OpenLiteSpeed or nginx in one click, with the site in its own Linux user and PHP pool. On OpenLiteSpeed the fixes from step 2 are part of the setup; you choose the PHP version per site in the panel. The Page cache and the Object cache are switches on the site's General pane, and Autotune sizes PHP and the database for the server's memory. See WordPress and Access, caching and protection.
Still choosing a web server? See nginx or OpenLiteSpeed.
Frequently asked questions
Why is OpenLiteSpeed fast for WordPress?
Its page cache is built into the web server. With the LiteSpeed Cache plugin, a cached page is answered without starting PHP or the database.
How do I know LiteSpeed Cache is working?
Look at the response headers. x-litespeed-cache: hit means the page came from the cache; miss means it was just built. No header means the cache is not active.
Why is LiteSpeed Cache not caching on OpenLiteSpeed?
Usually because .htaccess is not read. Set enable 1 and autoLoadHtaccess 1 in the rewrite block of the virtual host and restart the server.
Which PHP versions does OpenLiteSpeed have on Ubuntu 26.04?
LiteSpeed's repository has lsphp82, lsphp83, lsphp84 and lsphp85 for Ubuntu 26.04. There is no separate OPcache package for 8.5; it is built in.
Do I need Redis for WordPress on OpenLiteSpeed?
Not for a site read by anonymous visitors; the page cache covers them. An object cache helps shops, membership sites and the admin area.
See Web stack for the web servers and PHP versions Zefily installs.