To set up LiteSpeed on a Linux server, choose OpenLiteSpeed (free) or LiteSpeed Enterprise (licensed), install the LiteSpeed repository, install the web server and lsphp, open firewall ports, secure the WebAdmin console, create listeners and virtual hosts, enable HTTPS, and tune performance with LSCache, HTTP/3 (QUIC), and compression.
In this guide, I’ll show you how to setup LiteSpeed on Linux Server step by step, covering OpenLiteSpeed and LiteSpeed Web Server Enterprise. You’ll learn installation, firewall rules, WebAdmin configuration, PHP (LSAPI), HTTPS, WordPress optimization, and performance tuning—using simple, production-safe instructions.
What is LiteSpeed and Which Edition Should You Use?

LiteSpeed is a high‑performance, drop‑in replacement for Apache with outstanding HTTP/3, cache, and PHP LSAPI support. There are two editions:
- OpenLiteSpeed (OLS): Free, open-source, blazing fast, ideal for most sites, uses its own config format (rewrites compatible with most .htaccess rules). Default demo site listens on port 8088.
- LiteSpeed Enterprise (LSWS): Licensed, fully compatible with Apache config and .htaccess, integrates with cPanel/Plesk/DirectAdmin, adds advanced features and enterprise support.
For WordPress, both work exceptionally well with the LiteSpeed Cache (LSCache) plugin. Use Enterprise if you need full Apache compatibility or panel integrations; use OLS for a cost‑effective, high‑performance stack.
Prerequisites
- Fresh Linux server (Ubuntu/Debian or RHEL/Rocky/Alma/CentOS 7/8+)
- Root or sudo access
- A domain pointed to your server’s IP
- Firewall access for ports 80, 443, and 7080 (WebAdmin)
- Optional: a valid LiteSpeed Enterprise license (for LSWS)
Install LiteSpeed Repositories
LiteSpeed provides a single bootstrap script to add official repositories for both OpenLiteSpeed and Enterprise plus lsphp packages.
# Ubuntu/Debian
sudo apt update
sudo apt install -y curl ca-certificates gnupg
curl -s https://repo.litespeed.sh | sudo bash
# RHEL/Rocky/Alma/CentOS
sudo yum install -y curl ca-certificates
curl -s https://repo.litespeed.sh | sudo bash
Install OpenLiteSpeed (Free)
OpenLiteSpeed is perfect for most deployments. Install the server and PHP (LSAPI) packages:
# Ubuntu/Debian
sudo apt install -y openlitespeed
sudo apt install -y lsphp82 lsphp82-common lsphp82-mysql lsphp82-opcache lsphp82-curl
# RHEL/Rocky/Alma/CentOS
sudo yum install -y openlitespeed
sudo yum install -y lsphp82 lsphp82-common lsphp82-mysqlnd lsphp82-opcache lsphp82-curl
# Set the WebAdmin password
sudo /usr/local/lsws/admin/misc/admpass.sh
# Start and enable
sudo /usr/local/lsws/bin/lswsctrl start
sudo systemctl enable lshttpd
OpenLiteSpeed’s default demo site uses port 8088. The WebAdmin console listens on port 7080. Access it at https://YOUR_SERVER_IP:7080 and log in using the password you set.
Install LiteSpeed Enterprise (Licensed)
Enterprise is a drop‑in Apache replacement with full .htaccess and panel support. After adding the repo, install and start it:
# Ubuntu/Debian
sudo apt install -y litespeed
# RHEL/Rocky/Alma/CentOS
sudo yum install -y litespeed
# Set WebAdmin password
sudo /usr/local/lsws/admin/misc/admpass.sh
# Start and enable
sudo /usr/local/lsws/bin/lswsctrl start
sudo systemctl enable lshttpd
During or after installation you’ll add your license key (trial or paid). WebAdmin is also on port 7080.
Open Firewall Ports (UFW or firewalld)
Allow HTTP, HTTPS, and WebAdmin (7080). For HTTP/3 enable UDP/443 as well.
# UFW (Ubuntu)
sudo ufw allow 80,443/tcp
sudo ufw allow 7080/tcp
sudo ufw allow 443/udp # for HTTP/3/QUIC
sudo ufw reload
# firewalld (RHEL family)
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=7080/tcp
sudo firewall-cmd --permanent --add-port=443/udp # for HTTP/3/QUIC
sudo firewall-cmd --reload
Secure WebAdmin and Basic Hardening
- Use a strong WebAdmin password and limit access to specific IPs via WebAdmin > Configuration > Security.
- Change default ports if required by policy.
- Disable or restrict directory listing, and keep the server updated.
- Stop conflicting services on port 80/443:
sudo systemctl disable --now apache2 httpd nginx.
Create Listeners, Virtual Hosts, and Map Your Domain
In WebAdmin, create production listeners on ports 80 (HTTP) and 443 (HTTPS) and map them to virtual hosts for each domain.
- Listeners: Add listener “HTTP” on 0.0.0.0:80 and “HTTPS” on 0.0.0.0:443 (with certificates).
- Virtual Host: Create a vHost with a doc root (e.g., /var/www/example.com/public), enable Rewrite Rules, and add an Access Log.
- Map: Under each listener, add a Virtual Host Mapping for example.com and www.example.com.
Configure PHP with LSAPI (lsphp)
LSAPI gives excellent PHP performance. Install the targeted version (e.g., PHP 8.2 via lsphp82) and configure the External App and Script Handler:
- External App: Type “LiteSpeed SAPI App”, name “lsphp82”, command: /usr/local/lsws/lsphp82/bin/lsphp
- Script Handler: Suffix “php” mapped to handler “lsphp82”
- Opcache: Ensure lsphp-opcache is installed and enabled for better performance.
Restart LiteSpeed to apply changes.
sudo /usr/local/lsws/bin/lswsctrl restart
Enable HTTPS (Let’s Encrypt)
Issue a certificate with Certbot (webroot method) or your preferred ACME client, then attach the cert/key in the HTTPS listener.
# Certbot (Ubuntu/Debian)
sudo apt install -y certbot
sudo mkdir -p /var/www/example.com/public
sudo certbot certonly --webroot -w /var/www/example.com/public -d example.com -d www.example.com
# Paths to use in WebAdmin (Listener > SSL)
# Cert file: /etc/letsencrypt/live/example.com/fullchain.pem
# Private key: /etc/letsencrypt/live/example.com/privkey.pem
# Reload after attaching certs
sudo /usr/local/lsws/bin/lswsctrl reload
Deploy a Test Site (or WordPress)
Place an index.php in your document root to verify PHP is handled by lsphp.
echo '<?php phpinfo(); ?>' | sudo tee /var/www/example.com/public/index.php
For WordPress, create a database, download WordPress to your doc root, and install the LiteSpeed Cache plugin from the WordPress plugin directory. In plugin settings, enable Cache, Object Cache (Redis if available), and QUIC.cloud CDN if desired.
Performance Tuning Essentials
- HTTP/3 (QUIC): Enable in WebAdmin (Server > Tuning), and ensure UDP/443 is open. Verify with
curl -I --http3 https://example.com. - Compression: Enable Brotli and Gzip in WebAdmin (Server > Tuning > Compression).
- LSCache: Use the LiteSpeed Cache plugin for WordPress. Enable ESI, Image Optimization, CSS/JS combine/defer where appropriate.
- Workers/Connections: Tune “Server > Tuning > Connection” and “Server > Tuning > Request/Response” to match CPU/RAM and concurrency.
- Static File Handling: Serve static assets via LiteSpeed, set cache-control headers, and offload to a CDN for global reach.
Migrating from Apache or Nginx
- Apache -> LiteSpeed Enterprise: LSWS reads Apache configs and honors .htaccess. Switch services and test vhosts before cutting over.
- Apache/Nginx -> OpenLiteSpeed: Recreate virtual hosts in OLS. Most rewrite rules work; test WordPress permalinks and redirects. Use WebAdmin Rewrite Testing tools.
- Panel users: Consider LSWS with cPanel/Plesk/DirectAdmin for a streamlined migration path.
Service Management and Logs
Use lswsctrl or systemd to control the service, and check logs during setup and troubleshooting.
# Control
sudo /usr/local/lsws/bin/lswsctrl status
sudo /usr/local/lsws/bin/lswsctrl start
sudo /usr/local/lsws/bin/lswsctrl restart
sudo /usr/local/lsws/bin/lswsctrl stop
# Logs
sudo tail -f /usr/local/lsws/logs/error.log
sudo tail -f /usr/local/lsws/logs/access.log
Troubleshooting Quick Wins
- Admin panel not loading: Confirm 7080 is open and service is running; check error.log for SSL mismatch.
- Port 80/443 in use: Stop Apache/Nginx:
sudo systemctl disable --now apache2 httpd nginxthen restart LiteSpeed. - WordPress permalinks break: Enable Rewrite in the vHost and ensure .htaccess is present. In OLS, apply changes and gracefully restart.
- SSL not working: Ensure correct certificate/key paths and fullchain usage, then reload LiteSpeed.
- High CPU: Enable cache, OPCache, and review long‑running PHP scripts; consider upgrading to lsphp 8.2/8.3.
When to Choose Managed LiteSpeed Hosting
If you want LiteSpeed pre‑installed, tuned for HTTP/3, and paired with proactive security and backups, a managed plan saves time. At YouStable, our LiteSpeed‑optimized VPS and dedicated servers ship with lsphp, LSCache, and hardened configs, so you can focus on your apps instead of server plumbing.
FAQs: How to Setup LiteSpeed on Linux Server
Is OpenLiteSpeed free and production‑ready?
Yes. OpenLiteSpeed is free, open‑source, and production‑grade. It delivers the same event‑driven architecture and LSAPI performance as Enterprise but uses its own config format and lacks some enterprise features. For panel integration and full Apache config compatibility, use LiteSpeed Enterprise.
How do I enable HTTP/3 (QUIC) in LiteSpeed?
Open WebAdmin and enable HTTP/3/QUIC under Server > Tuning. Open UDP port 443 on your firewall, attach a valid TLS certificate on the HTTPS listener, and reload LiteSpeed. Verify with: curl -I --http3 https://yourdomain.com.
Can I use LiteSpeed with cPanel or Plesk?
Yes. LiteSpeed Enterprise integrates with cPanel, Plesk, and DirectAdmin as an Apache drop‑in replacement. It reads Apache vhost configs and .htaccess, making migrations smooth and minimizing downtime.
How do I switch from Apache to LiteSpeed without downtime?
Install LiteSpeed Enterprise in parallel, validate virtual hosts and SSL in staging, then stop Apache and start LiteSpeed. Keep the same document roots and .htaccess. For OLS, recreate vHosts and test rewrites before the cutover, then change DNS/ports during a maintenance window.
Which ports does LiteSpeed use and what should I open?
Open TCP 80 (HTTP), TCP 443 (HTTPS), and TCP 7080 (WebAdmin). For HTTP/3, also open UDP 443. OpenLiteSpeed’s demo listener uses TCP 8088. Restrict WebAdmin to your IP for security.
Conclusion
Now you know how to setup LiteSpeed on Linux Server the right way: install OLS or Enterprise, secure WebAdmin, create listeners and vHosts, configure lsphp, enable HTTPS, and tune performance with HTTP/3 and LSCache. If you prefer a managed, battle‑tested stack, YouStable’s LiteSpeed‑optimized hosting is ready to launch your sites at peak speed.