To use LiteSpeed on a Linux server, pick OpenLiteSpeed (free) or LiteSpeed Enterprise (commercial), install it via your distro’s package manager or a script, secure the WebAdmin console, create listeners and virtual hosts, connect PHP (LSAPI), enable TLS/HTTP/3, configure LSCache for your apps, then benchmark and tune for your workload.
Looking for a fast, secure web stack? This step by step guide shows you exactly how to use LiteSpeed on a Linux server installation, initial configuration, SSL/HTTP/3, PHP, caching, optimization, and troubleshooting.
Whether you deploy OpenLiteSpeed or LiteSpeed Enterprise, you’ll learn practical, real-world techniques that we use at YouStable to deliver high-performance hosting.
What is LiteSpeed and Why Use it on Linux?
LiteSpeed Web Server (LSWS) is a drop in Apache replacement known for its event-driven architecture, built in caching (LSCache), and native HTTP/3/QUIC support.
It excels at handling high concurrency with low CPU/RAM, making it ideal for WordPress, WooCommerce, Magento, and any PHP-based application.
OpenLiteSpeed vs LiteSpeed Enterprise
- OpenLiteSpeed (OLS): Free, open source, great for custom setups and single-tenant sites. Manual vhost management via WebAdmin.
- LiteSpeed Enterprise (LSWS): Commercial, full Apache config compatibility (httpd.conf/htaccess), cPanel/DirectAdmin/WHMCS integrations, ESI, advanced WAF, and enterprise support.
- Shared hosting or cPanel stack: choose Enterprise. Single VPS or developer stack: OLS is usually enough.
Prerequisites and System Requirements
- Linux distro: Ubuntu 20.04/22.04/24.04, Debian 11/12, AlmaLinux/Rocky 8/9, or RHEL 8/9.
- Root or sudo access, public IP, configured DNS (A/AAAA), and open firewall ports (80, 443, 7080).
- Minimum 1 vCPU and 1–2 GB RAM for light sites; 4+ vCPU and 8+ GB RAM for busy WordPress/WooCommerce.
- Time sync enabled (chrony or systemd-timesyncd) for TLS and ACME issuance.
Install Options: OpenLiteSpeed and LiteSpeed Enterprise
Option A: Install OpenLiteSpeed on Ubuntu/Debian
# Ubuntu/Debian - OpenLiteSpeed + PHP
sudo apt update
sudo apt install -y software-properties-common curl
wget -O - https://repo.litespeed.sh | sudo bash
sudo apt install -y openlitespeed lsphp81 lsphp81-common lsphp81-mysql lsphp81-curl lsphp81-xml lsphp81-zip
# Set WebAdmin password
sudo /usr/local/lsws/admin/misc/admpass.sh
# Start and enable
sudo systemctl enable --now lsws
# UFW firewall (if enabled)
sudo ufw allow 80,443,7080/tcpOption B: Install OpenLiteSpeed on AlmaLinux/Rocky/RHEL
# RHEL-based - OpenLiteSpeed + PHP
sudo dnf install -y epel-release curl
bash <(curl -Ss https://repo.litespeed.sh)
sudo dnf install -y openlitespeed lsphp81 lsphp81-mysql lsphp81-common
sudo /usr/local/lsws/admin/misc/admpass.sh
sudo systemctl enable --now lsws
# firewalld
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 --reloadOption C: Install LiteSpeed Enterprise (LSWS)
Use LiteSpeed’s installer to add LSWS with a trial license. Enterprise works seamlessly with Apache-style configs and popular control panels.
# Enterprise LSWS installer
wget https://www.litespeedtech.com/packages/5.0/lsws-6.3.1-ent-x86_64-linux.tar.gz
tar -xzf lsws-*.tar.gz && cd lsws-*
sudo ./install.sh
# During setup: choose trial license, admin user, ports, and PHP edition.
# Start service:
sudo /usr/local/lsws/bin/lswsctrl start
sudo systemctl enable lswsOption D: Use a Control Panel
- cPanel/WHM: Install LSWS Enterprise via the LiteSpeed WHM plugin; keeps Apache compatibility.
- CyberPanel: Ships with OpenLiteSpeed, one-click WordPress + LSCache + SSL.
- DirectAdmin: Official LSWS integration with per-user vhost management.
Initial Configuration and WebAdmin Basics
Access the WebAdmin console at https://YOUR-IP:7080. Log in with the credentials you set using admpass.sh. Always change defaults, use a strong password, and restrict access to your IP when possible.
Create Listener and Virtual Host
- Listener: Bind to 0.0.0.0:80 and 0.0.0.0:443.
- Virtual Host: Create a vhost with a document root (e.g., /var/www/example.com/public).
- Map domain to vhost: Under Listener > Virtual Host Mappings, add example.com and www.example.com.
Connect PHP via LSAPI
Install lsphp packages matching your PHP version. In WebAdmin, go to Server Configuration > External App and add an LSAPI app for lsphp81. Then set a Script Handler for suffix “php” to your LSAPI app.
# Typical lsphp binary path (Ubuntu/Debian)
sudo ls -l /usr/local/lsws/lsphp81/bin/php
# Reload LSWS after changes
sudo /usr/local/lsws/bin/lswsctrl reloadEnable HTTPS and HTTP/3 (QUIC)
LiteSpeed supports TLS 1.3 and HTTP/3 out of the box. Use Let’s Encrypt with Certbot or acme.sh, then point your vhost listener to the certificate and key files. Ensure UDP/443 is open for HTTP/3/QUIC if your firewall allows service-based rules.
# Issue Let's Encrypt cert (example.com)
sudo snap install core && sudo snap refresh core
sudo snap install --classic certbot
sudo certbot certonly --webroot -w /var/www/example.com/public -d example.com -d www.example.com
# Cert paths (Debian/Ubuntu default)
# /etc/letsencrypt/live/example.com/fullchain.pem
# /etc/letsencrypt/live/example.com/privkey.pem
# firewalld: allow HTTP/3 (UDP/443)
sudo firewall-cmd --permanent --add-port=443/udp
sudo firewall-cmd --reloadTurn On HTTP/3 in WebAdmin
- Listener > SSL: Load the certificate and key.
- Server Configuration > Tuning: Enable QUIC and set HTTP/3 support to On.
- Restart LSWS to apply changes.
Install and Configure LSCache
LSCache is LiteSpeed’s built-in, rewrite-aware caching engine. For WordPress and other CMSs, use an official plugin to auto-generate cache rules, minify assets, and offload image/webP optimization via QUIC.cloud.
WordPress + LiteSpeed Cache Plugin
- Install the LiteSpeed Cache plugin from the WordPress repository.
- Enable cache, set TTLs, and turn on object cache (Redis/Memcached) for dynamic sites.
- Use ESI for personalized fragments (cart, account boxes) on WooCommerce.
- Connect QUIC.cloud for image optimization, CDN, and page-level cache warmup.
Performance Tuning for Real Workloads
Core Server Settings
- Max Connections: Size for expected concurrency (e.g., 2–4x typical concurrent users).
- Worker Processes: Usually 1–2 per CPU socket; avoid oversubscription on small VPS.
- Memory and Buffering: Increase if you serve large responses or high concurrency.
- Gzip/Brotli: Enable for text assets; combine with HTTP/3 for best latency.
PHP and Database
- OPcache: Turn on OPcache with adequate memory (128–256 MB for busy WordPress).
- PHP Workers: Set LSAPI children by measuring peak requests and response times.
- Object Cache: Use Redis/Memcached for WooCommerce, LMS, forums.
- Database: Tune innodb_buffer_pool_size and query cache equivalents (if applicable) for MySQL/MariaDB.
Security Hardening
- Limit WebAdmin by IP and enforce strong passwords.
- Enable reCAPTCHA, anti-DDoS connection throttling, and request/response body limits.
- WAF: Use ModSecurity with a reputable ruleset on LSWS Enterprise.
- OS Security: Keep kernel and packages updated; use Fail2ban for SSH, and SELinux/AppArmor appropriately configured.
Monitoring, Logs, and Maintenance
- Logs: /usr/local/lsws/logs/error.log and access.log (paths may vary per distro).
- Real-Time Stats: WebAdmin > Server Monitor for connections, requests, cache hits.
- System Tools: top/htop, iostat, vmstat, and ss/netstat for sockets and load.
- Backups: Version your vhost configs and back up certificates and WebAdmin config.
Essential Commands and Paths
# Service control
sudo systemctl status lsws
sudo systemctl restart lsws
sudo /usr/local/lsws/bin/lswsctrl restart
# WebAdmin password
sudo /usr/local/lsws/admin/misc/admpass.sh
# Logs (common)
sudo tail -f /usr/local/lsws/logs/error.log
sudo tail -f /usr/local/lsws/logs/access.log
# Firewall quick refs
sudo ufw allow 80,443,7080/tcp
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --permanent --add-port=7080/tcp --add-port=443/udp
sudo firewall-cmd --reloadTroubleshooting Common Issues
503 Service Unavailable
- Cause: PHP LSAPI crashed or hit limits.
- Fix: Increase LSAPI children, check PHP error logs, ensure OPcache enabled, restart lsws and php.
403/404 Errors After Deployment
- Cause: Wrong document root, permissions (www-data or nobody), or missing rewrite rules.
- Fix: Correct docroot, set file perms (644/755), ensure .htaccess or rewrite rules exist (Enterprise reads .htaccess; OLS needs rules added in WebAdmin).
SSL Padlock Missing
- Cause: Mixed content or incomplete chain.
- Fix: Serve HTTPS-only assets and use fullchain.pem; clear LSCache and browser cache.
OpenLiteSpeed or LiteSpeed Enterprise: Which Should You Choose?
- Choose OpenLiteSpeed if you manage a single VPS, prefer WebAdmin-managed vhosts, and want a free, high-performance stack.
- Choose Enterprise if you need Apache compatibility, a hosting panel (cPanel/DirectAdmin), per-user isolation, ESI, WAF, and vendor support.
Real-World Workflow Example (WordPress)
- Provision a VPS (2 vCPU/4 GB RAM) on Ubuntu 22.04.
- Install OpenLiteSpeed + lsphp81 and set WebAdmin password.
- Create vhost for example.com, set docroot, and map domains.
- Install MariaDB, create database and user for WordPress.
- Issue Let’s Encrypt cert, enable TLS/HTTP/3 in Listener.
- Install WordPress, add LiteSpeed Cache plugin, enable object cache (Redis), and tweak TTLs.
- Benchmark with k6 or wrk and adjust LSAPI children, cache settings, and Brotli.
When Managed Hosting Saves Time
If you’d rather skip server administration, YouStable offers LiteSpeed-optimized hosting and VPS plans with pre-tuned LSWS/OLS, LSCache, Redis, HTTP/3, and proactive monitoring. You get the performance benefits without the maintenance overhead—ideal for agencies, ecommerce, and busy publishers.
FAQ’s
u003cstrongu003eIs LiteSpeed faster than Nginx or Apache for WordPress?u003c/strongu003e
In many WordPress workloads, yes. LSCache’s server-level cache and LSAPI for PHP reduce CPU and TTFB under load. With HTTP/3 and optimized TLS, LiteSpeed often serves more requests per second than Apache and can edge out Nginx when full-page and object caching are tuned.
u003cstrongu003eHow do I install OpenLiteSpeed on Ubuntu quickly?u003c/strongu003e
Run the LiteSpeed repo script, install openlitespeed and lsphp, set the WebAdmin password, and start the service. Then access https://SERVER-IP:7080 to configure listeners, vhosts, and PHP handlers. The commands in this guide provide a copy-paste start.
u003cstrongu003eCan LiteSpeed serve HTTP/3 (QUIC) by default?u003c/strongu003e
Yes. Enable QUIC/HTTP/3 in Server Configuration, load your TLS certificate on the HTTPS listener, and open UDP/443 in your firewall. Use tools like curl with HTTP/3 support or online testers to verify.
u003cstrongu003eWhat’s the difference between OpenLiteSpeed and LiteSpeed Enterprise?u003c/strongu003e
OpenLiteSpeed is free and uses WebAdmin-managed configs; it doesn’t read .htaccess runtime. Enterprise is commercial, compatible with Apache configs and control panels, includes advanced WAF/ESI, and is built for multi-tenant hosting. Performance is comparable; features and integrations differ.
u003cstrongu003eHow do I enable LiteSpeed Cache for WordPress?u003c/strongu003e
Install and activate the LiteSpeed Cache plugin, turn on cache, set TTLs, enable object cache (Redis/Memcached), and configure image/CSS/JS optimizations. For best results, pair with QUIC.cloud CDN and warm up cache after deployment.u003cbru003eu003cbru003eBy following the steps above, you can confidently deploy LiteSpeed on a Linux server, unlock HTTP/3 performance, and accelerate your PHP applications. If you need a ready-to-go stack, YouStable’s LiteSpeed hosting gives you expert configuration, proven reliability, and ongoing optimization.
