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:
Always up-to-date packages
Easy installation and updates
Officially supported builds
Optimized PHP (LSPHP) integration
Compatible with system package managers (apt, dnf, yum)
Supported Operating Systems
OpenLiteSpeed supports current and non-EOL versions of the following Linux distributions:
- CentOS / RHEL-based
- CentOS Stream 8, 9, 10
- Red Hat Enterprise Linux (RHEL)
- AlmaLinux
- Rocky Linux
- CloudLinux
- Oracle Linux
- VzLinux
- Debian-based
- Debian 11, 12, 13
- Ubuntu 20 (EOL May 31, 2025)
- Ubuntu 22.04 LTS
- 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:
- Adds LiteSpeed’s official repository
- Imports signing keys
- Configures your package manager automatically
Once completed, your system is ready to install OpenLiteSpeed and LSPHP.
Step 2: Install OpenLiteSpeed
sudo apt-get update sudo apt-get -y install openlitespeedCentOS / RHEL / AlmaLinux / Rocky Linux:
sudo dnf install -y openlitespeedAfter installation, OpenLiteSpeed will be installed under: /usr/local/lsws/
Step 3: Install LSPHP (LiteSpeed PHP)
- lsphp84
- lsphp84-common
- lsphp84-mysql
sudo apt-get install -y lsphp84 lsphp84-common lsphp84-mysqlCentOS / RHEL-based
sudo dnf install -y lsphp84 lsphp84-common lsphp84-mysqlWhen 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
Username: admin Password: Randomly generatedThe password is stored in:
/usr/local/lsws/adminpasswdNote: 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:
- Configure PHP settings in OpenLiteSpeed
- Create virtual hosts
- Install WordPress with LiteSpeed Cache
- Enable HTTPS with Let’s Encrypt
- 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.