linuxenabled.com

How to Install OpenLiteSpeed and PHP from the LiteSpeed Repository (Step-by-Step Guide)

Introduction

OpenLiteSpeed is a high-performance, open-source web server developed by LiteSpeed Technologies. It’s widely used for hosting PHP applications due to its speed, low resource usage, and built-in security features. In this guide, you’ll learn how to install OpenLiteSpeed and LSPHP from the official LiteSpeed Repository on popular Linux distributions such as Ubuntu, Debian, CentOS, AlmaLinux, and Rocky Linux.

Why Use the LiteSpeed Repository? Installing OpenLiteSpeed from the LiteSpeed Repository offers several advantages:

  1. ✅ Always up-to-date packages
  2. ✅ Easy installation and updates
  3. ✅ Officially supported builds
  4. ✅ Optimized PHP (LSPHP) integration
  5. ✅ Compatible with system package managers (apt, dnf, yum)

Supported Operating Systems

OpenLiteSpeed supports current and non-EOL versions of the following Linux distributions:

  1. CentOS / RHEL-based
  2. CentOS Stream 8, 9, 10
  3. Red Hat Enterprise Linux (RHEL)
  4. AlmaLinux
  5. Rocky Linux
  6. CloudLinux
  7. Oracle Linux
  8. VzLinux
  9. Debian-based
  10. Debian 11, 12, 13
  11. Ubuntu 20 (EOL May 31, 2025)
  12. Ubuntu 22.04 LTS
  13. Ubuntu 24.04 LTS

⚠️ Tip: Always use a supported, non-EOL OS for security and long-term updates.

Step 1: Install the LiteSpeed Repository

First, add the official LiteSpeed package repository to your system.

Run the following command as root or with sudo:

sudo wget -O - https://repo.litespeed.sh | sudo bash

What This Does:

  1. Adds LiteSpeed’s official repository
  2. Imports signing keys
  3. Configures your package manager automatically

Once completed, your system is ready to install OpenLiteSpeed and LSPHP.

Step 2: Install OpenLiteSpeed

Debian / Ubuntu:
sudo apt-get update
sudo apt-get -y install openlitespeed
CentOS / RHEL / AlmaLinux / Rocky Linux:
sudo dnf install -y openlitespeed
After installation, OpenLiteSpeed will be installed under: /usr/local/lsws/

Step 3: Install LSPHP (LiteSpeed PHP)

LSPHP is LiteSpeed’s optimized PHP implementation, designed to work seamlessly with OpenLiteSpeed. Run the following commands to install PHP 8.4 and MySQL Support. The commands will install:
  1. lsphp84
  2. lsphp84-common
  3. lsphp84-mysql
Debian / Ubuntu
sudo apt-get install -y lsphp84 lsphp84-common lsphp84-mysql
CentOS / RHEL-based
sudo dnf install -y lsphp84 lsphp84-common lsphp84-mysql
When the installation completes, the PHP binary will be located at:
/usr/local/lsws/lsphp84/bin/lsphp

Step 4: List Available LSPHP Extensions

If you want to install additional PHP extensions (such as curl, gd, intl, or opcache), you can list all available LSPHP packages.

Debian / Ubuntu

sudo apt-cache search lsphp

CentOS / RHEL-based

sudo dnf search lsphp

Install any extension you need, for example:

sudo apt-get install lsphp84-curl lsphp84-gd lsphp84-intl

Step 5: Access the OpenLiteSpeed WebAdmin Console

OpenLiteSpeed includes a powerful WebAdmin GUI for server and virtual host management. To access the openlitespeed webadmin console open a browser window and navigate to http://server-ip-address:8080. Use the following credentials to login to the webadmin console: Default WebAdmin Credentials:
Username: admin
Password: Randomly generated
The password is stored in:
/usr/local/lsws/adminpasswd
Note: You may see a browser warning due to the self-signed SSL certificate. This is normal.

Step 6: Set or Reset the WebAdmin Password

To set or reset the admin password, run:

sudo /usr/local/lsws/admin/misc/admpass.sh

Follow the prompts to create a new secure password.

Conclusion

After installation, you can:

  1. Configure PHP settings in OpenLiteSpeed
  2. Create virtual hosts
  3. Install WordPress with LiteSpeed Cache
  4. Enable HTTPS with Let’s Encrypt
  5. Optimize performance with LSCache

Installing OpenLiteSpeed from the official LiteSpeed Repository is the fastest and most reliable way to get a modern, high-performance web server running on Linux. Combined with LSPHP, it delivers excellent speed, security, and scalability for PHP applications.

Whether you’re running a small blog or a high-traffic production site, OpenLiteSpeed is a powerful alternative to Apache and Nginx.

Scroll to Top