1. Home
  2. Guides
  3. How to install LiteSpeed on cPanel and switch from Apache

How to install LiteSpeed on cPanel and switch from Apache

By the PikoLicense team · Published

LiteSpeed reads Apache's configuration and .htaccess files, so switching a cPanel server takes a few minutes and your sites do not need changes.

Before you start

  • A cPanel & WHM server with EasyApache 4.
  • A LiteSpeed Web Server Enterprise license for that server and its serial number (shown in your license details). The free OpenLiteSpeed edition is not supported on cPanel.
  • Root SSH access.

1. Run the LiteSpeed auto-installer

LiteSpeed's official installer sets up both LiteSpeed Web Server and the WHM plugin. Replace YOUR_SERIAL with your serial number:

bash <( curl https://get.litespeed.sh ) YOUR_SERIAL

LiteSpeed installs next to Apache. Nothing changes for your sites yet: Apache keeps serving traffic until you switch.

2. Switch from Apache to LiteSpeed

In WHM, open Plugins → LiteSpeed Web Server and choose Switch to LiteSpeed. LiteSpeed takes over ports 80 and 443 and reads the existing Apache configuration and every account's .htaccess.

3. Check that LiteSpeed is serving

curl -sI https://one-of-your-domains.com | grep -i server

The response should show server: LiteSpeed. Open a few sites, including one with custom rewrite rules, to make sure they behave as before.

4. Check the PHP packages

LiteSpeed runs PHP through its own LSAPI interface. On cPanel it uses EasyApache 4's PHP builds, which need the LiteSpeed SAPI package for each PHP version (named like ea-php83-php-litespeed). The installer normally adds it; if a site shows PHP errors after the switch, install the missing package in EasyApache 4 for that PHP version.

5. Turn on LSCache

LSCache is LiteSpeed's full-page cache. It needs a plugin inside each site; for WordPress, install the free LiteSpeed Cache plugin. The WHM plugin can mass-enable it for all WordPress installs on the server. Plugins also exist for WooCommerce, Joomla, Drupal, Magento and others.

Switching back to Apache

If something does not work, go to Plugins → LiteSpeed Web Server in WHM and choose Switch to Apache. Apache's configuration is untouched, so this takes seconds.

Running several servers? LiteSpeed Web ADC load-balances them. Just setting up the server? Start with how to install cPanel on AlmaLinux.