OpenLiteSpeed is a high-performance, open-source web server known for excellent PHP performance (via LSPHP) and built-in HTTP/3 support, making it a popular alternative to Nginx and Apache, especially for WordPress hosting.
Prerequisites
- Ubuntu 22.04/24.04 or Debian 11/12 VPS
- Root or sudo access
Step 1 — Add the OpenLiteSpeed Repository
wget -O - https://repo.litespeed.sh | sudo bash
Step 2 — Install OpenLiteSpeed
sudo apt update
sudo apt install openlitespeed -y
Step 3 — Install LSPHP (LiteSpeed's PHP Implementation)
sudo apt install lsphp83 lsphp83-mysql lsphp83-common -y
Adjust the version number (e.g. lsphp82) based on which PHP release you need.
Step 4 — Set the Admin Password
sudo /usr/local/lsws/admin/misc/admpass.sh
Step 5 — Start OpenLiteSpeed
sudo systemctl enable lsws
sudo systemctl start lsws
sudo systemctl status lsws
Step 6 — Open the Required Ports
sudo ufw allow 7080/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
Step 7 — Access the Admin Console
https://YOUR_SERVER_IP:7080
Log in with the admin username and the password set in Step 4. Your browser will warn about the self-signed certificate — this is expected for the admin console.
Step 8 — Verify the Default Website
http://YOUR_SERVER_IP
Setting Up a Virtual Host
Virtual hosts in OpenLiteSpeed are managed through the WebAdmin Console under Virtual Hosts → Add, rather than editing text config files directly — a key workflow difference from Nginx/Apache.
OpenLiteSpeed vs Nginx vs Apache
| Feature | OpenLiteSpeed | Nginx | Apache |
|---|---|---|---|
| PHP handling | Built-in LSPHP (very fast) | Requires PHP-FPM | mod_php or PHP-FPM |
| .htaccess support | Yes | No | Yes |
| Admin interface | Web-based console | Config files | Config files |
| HTTP/3 | Built-in | Requires extra modules | Requires extra modules |
Common Errors
Can't reach port 7080 — confirm the firewall rule and that lsws is running: sudo systemctl status lsws.
PHP files download instead of executing — confirm LSPHP is installed and correctly selected in the virtual host's PHP settings within the admin console.
Best Practices
- Change the default admin console port and restrict it to trusted IPs if possible
- Keep OpenLiteSpeed and LSPHP updated together
- Use the WebAdmin Console rather than manually editing config files, to avoid syntax errors
FAQ
Is OpenLiteSpeed free?
Yes, unlike the commercial LiteSpeed Enterprise product, OpenLiteSpeed is free and open source.
Related Articles
- How to Install Nginx on Ubuntu & Debian
- How to Install PHP 8.4 on Ubuntu 24.04 VPS
- How to Install Let's Encrypt SSL with Certbot (Nginx & Apache)
