LiteSpeed Web Server (LSWS) is a faster drop-in replacement for Apache. It reads the same configuration and .htaccess files, and adds a built-in page cache (LSCache) and HTTP/3. On a cPanel server it can replace Apache without changing any websites, and you can switch back at any time.
Quick answer
-
In WHM, make sure mod_ruid2 is disabled in EasyApache 4, and open ports TCP 80, 443 and UDP 443 in the firewall.
-
As root, run the installer with your license key (or
TRIAL):bash <( curl https://get.litespeed.sh ) YOUR_SERIAL_NO -
Accept the default answers, test your sites on LiteSpeed's test port, then switch in WHM › Plugins › LiteSpeed Web Server › Switch to LiteSpeed.
What you need: LiteSpeed
- A working cPanel & WHM server with root SSH access, and websites that already work under Apache.
- A LiteSpeed license. A free Starter license covers one domain on a server with less than 2 GB RAM; bigger servers need a paid license, or a trial to start with.
- No other Apache replacement or reverse proxy (such as nginx or Varnish) in front of Apache. Remove those first.
Step 1: Prepare the server
Disable mod_ruid2. In WHM › Software › EasyApache 4, customize the current profile and make sure mod_ruid2 is off. LiteSpeed does not work with it. LiteSpeed
Open the firewall ports. LiteSpeed needs: LiteSpeed
| Port | Used for |
|---|---|
| TCP 80, TCP 443 | websites (HTTP and HTTPS) |
| UDP 443 | HTTP/3 (QUIC) |
| TCP 7080 | LiteSpeed WebAdmin console; allow only your own IP addresses |
With CSF, add 443 to UDP_IN and UDP_OUT in /etc/csf/csf.conf, then run csf -r. See How to Install CSF Firewall.
Step 2: Run the installer
bash <( curl https://get.litespeed.sh ) YOUR_SERIAL_NO
Replace YOUR_SERIAL_NO with your license key, or with TRIAL (in capitals) to request a trial license. LiteSpeed
The installer detects cPanel and asks a few questions. The defaults are right for most servers:
| Question | Recommended answer |
|---|---|
| Could not find an lsws.options file... Continue? | Y |
| PHP_SUEXEC | 2 (run PHP as the account owner, in home directories) |
| Apache port offset | 1000: LiteSpeed runs on port 1080 next to Apache, so you can test first |
| Admin username | something other than admin |
| Admin email address | an address you read |
| EasyApache integration | leave the default; it only affects the old EasyApache 3 |
| Switch to LiteSpeed automatically | 0 (switch by hand after testing) |
| Deploy LSCWP automatically | 1 to install the LiteSpeed Cache plugin on WordPress sites |
| Install user-end cPanel plugin | 1 (users get LiteSpeed Web Cache Manager in cPanel) |
At the end, the installer prints a randomly generated password for the WebAdmin console. Save it in a password manager.
For many servers, you can put the answers in an lsws.options file next to the installer to skip the questions; LiteSpeed's guide lists the options. LiteSpeed
Step 3: Test, then switch to LiteSpeed
With a port offset of 1000, Apache keeps serving your sites on port 80 while LiteSpeed listens on port 1080. Open one or two sites as http://example.com:1080 and check that they work. (Open port 1080 in the firewall for your IP address only, while testing.)
When you are happy, switch:
-
In WHM › Plugins › LiteSpeed Web Server, click Switch to LiteSpeed, or
-
from the command line:
/usr/local/lsws/admin/misc/cp_switch_ws.sh lsws
To go back to Apache, click Switch to Apache, or run the same script with apache. LiteSpeed
Never switch by stopping httpd and starting lsws by hand. Switching involves more steps, and LiteSpeed's plugin or script does them all. LiteSpeed
Step 4: Check it works
The WHM LiteSpeed plugin page shows which web server is running. To check a website, look at its response headers:
curl -sI https://example.com/ | grep -iE '^server|x-litespeed-cache'
You should see server: LiteSpeed, and on WordPress sites with LSCache, x-litespeed-cache: hit or miss. LiteSpeed
Step 5: Turn on LSCache for WordPress
If you answered 0 to Deploy LSCWP during installation, set it up now in WHM › Plugins › LiteSpeed Web Server: LiteSpeed
- Open LSCWP Version Manager, choose the latest version, and click Switch Version.
- Under Cache Root Setup, click Set Missing Cache Roots.
- Open Manage Cache Installations, click Scan, then Mass Enable/Disable Cache › Start.
Sites that already use another full-page cache plugin are skipped. LiteSpeed
Keep LiteSpeed up to date
LiteSpeed Web Server can be upgraded from the WHM LiteSpeed plugin, or from the command line with: LiteSpeed
/usr/local/lsws/admin/misc/lsup.sh
Without options it installs the latest stable release. -f installs the newest "edge" build instead, and -v VERSION installs a specific version, for example to go back after a bug. A daily cron job should run lsup.sh without -f, so it only follows stable releases. LiteSpeed
The WHM LiteSpeed plugin is updated in WHM › WHM Plugins, or with: LiteSpeed
wget -O- https://litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh | sh
Change the WebAdmin password
The WebAdmin console is at https://your-server-hostname:7080. To set a new admin password:
/usr/local/lsws/admin/misc/admpass.sh
Troubleshooting
Sites show errors after switching. Switch back to Apache from the WHM plugin, so sites work again, then check that mod_ruid2 is off and no nginx or Varnish proxy is left. LiteSpeed
HTTP/3 does not work. UDP port 443 is closed, in your firewall or your provider's. LiteSpeed
The trial license request fails. LiteSpeed's quick start guide links to a trial license FAQ for these errors. Otherwise, use a paid or Starter license key instead of TRIAL. LiteSpeed