For our Blog Visitor only Get Additional 3 Month Free + 10% OFF on TriAnnual Plan YSBLOG10
Grab the Deal

How to Install LiteSpeed on Linux Server – (Step-by-Step Guide 2026)

To install LiteSpeed on a Linux server, choose OpenLiteSpeed (free) or LiteSpeed Enterprise (licensed), add the official repository, install the web server and LSAPI PHP (lsphp), start and enable the service, set the WebAdmin password, open ports 80/443/7080 in your firewall, create a virtual host, and enable HTTP/3 and LSCache for performance.

In this step-by-step guide, you’ll learn how to install LiteSpeed on Linux server environments (Ubuntu, Debian, RHEL, AlmaLinux, Rocky, CentOS), configure PHP, secure the WebAdmin console, add SSL, and optimize for WordPress with LSCache. I’ll also cover common pitfalls, performance tuning, and FAQs using clear, beginner-friendly language.

Why LiteSpeed for Linux Servers?

Why LiteSpeed for Linux Servers?

LiteSpeed Web Server (LSWS) is a high-performance, drop-in replacement for Apache that supports .htaccess, HTTP/2 and HTTP/3 (QUIC), and advanced caching. OpenLiteSpeed (OLS) is the free edition; Enterprise is the commercial edition with full Apache config compatibility, ESI, and enhanced features. Both are excellent for WordPress, WooCommerce, and high-traffic PHP sites.

Prerequisites

  • A Linux server (Ubuntu 22.04/24.04, Debian 11/12, RHEL/AlmaLinux/Rocky 8/9, or CentOS 7/Stream)
  • Root or sudo privileges
  • A domain name (recommended) pointed to your server’s IP
  • Firewall access to open ports: 80 (HTTP), 443 (HTTPS), 7080 (LiteSpeed WebAdmin), and 8088 (OpenLiteSpeed default test site)
  • No conflicting web server on port 80/443 (stop/disable Apache or Nginx if needed)

OpenLiteSpeed vs LiteSpeed Enterprise

Choose the edition that fits your stack before you install LiteSpeed on Linux server distributions:

OpenLiteSpeed (OLS)

  • Free and open-source
  • Great for WordPress, PHP apps, and developers comfortable with LiteSpeed’s native config
  • Admin panel on port 7080; default site on port 8088
  • Supports .htaccess and Apache rewrites (with minor differences in edge cases)

LiteSpeed Enterprise (LSWS)

  • Commercial license (trial available)
  • Drop-in Apache replacement with near-complete httpd.conf and .htaccess compatibility
  • Advanced features: ESI (edge-side includes), QUIC.cloud integration, and premium support
  • Best for cPanel/DirectAdmin environments or mission-critical production workloads

Step 1: Prepare Your Server

Update the OS and stop any web server bound to ports 80/443. On Ubuntu/Debian use apt; on RHEL variants use dnf.

# Ubuntu/Debian
sudo apt update && sudo apt -y upgrade
sudo systemctl stop apache2 nginx 2>/dev/null || true
sudo systemctl disable apache2 nginx 2>/dev/null || true

# RHEL/AlmaLinux/Rocky/CentOS
sudo dnf -y update
sudo systemctl stop httpd nginx 2>/dev/null || true
sudo systemctl disable httpd nginx 2>/dev/null || true

Step 2: Install OpenLiteSpeed (Free)

Ubuntu 22.04/24.04 and Debian 11/12

Add the official LiteSpeed repository, install OpenLiteSpeed and LSAPI PHP (lsphp), then enable the service.

sudo apt install -y curl
curl -s https://repo.litespeed.sh | sudo bash

sudo apt update
sudo apt install -y openlitespeed

# Install PHP 8.1 or 8.2 via LSAPI (choose one version)
sudo apt install -y lsphp81 lsphp81-common lsphp81-mysql lsphp81-opcache

# Start and enable
sudo systemctl enable --now lsws

# Set WebAdmin password (for https://<server_ip>:7080)
sudo /usr/local/lsws/admin/misc/admpass.sh

Point the OpenLiteSpeed PHP handler to the installed lsphp version:

# Symlink the PHP binary for OLS (adjust version if needed)
sudo ln -sf /usr/local/lsws/lsphp81/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp

# Restart LiteSpeed
sudo systemctl restart lsws

RHEL 8/9, AlmaLinux, Rocky, CentOS

Enable the repository, install OpenLiteSpeed and PHP, then start the service.

sudo dnf install -y epel-release curl
curl -s https://repo.litespeed.sh | sudo bash

sudo dnf install -y openlitespeed lsphp81 lsphp81-mysql lsphp81-opcache

sudo systemctl enable --now lsws
sudo /usr/local/lsws/admin/misc/admpass.sh

# Optional: link PHP handler
sudo ln -sf /usr/local/lsws/lsphp81/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp
sudo systemctl restart lsws

Firewall Notes

# UFW (Ubuntu/Debian)
sudo ufw allow 80,443/tcp
sudo ufw allow 7080/tcp
sudo ufw allow 8088/tcp    # OLS default test page
sudo ufw reload

# firewalld (RHEL/Alma/Rocky/CentOS)
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=8088/tcp
sudo firewall-cmd --reload

Access the WebAdmin at https://your_server_ip:7080 (self-signed certificate) and the default site at http://your_server_ip:8088.

Step 3: Install LiteSpeed Web Server Enterprise

LiteSpeed Enterprise is ideal if you want a seamless Apache replacement and advanced features. You can run it interactively with a trial or license key.

# Download installer
wget https://www.litespeedtech.com/packages/lsws/install.sh
sudo bash install.sh

# Follow prompts to:
# - Accept license
# - Choose install path (/usr/local/lsws)
# - Set admin user/password
# - Provide serial number (or trial)
# - Select lsphp version (e.g., 8.1/8.2)
# - Bind to ports 80/443 for production

After installation, the service is named “lsws.” Manage it with systemd or the control script.

sudo systemctl enable --now lsws
# or
sudo /usr/local/lsws/bin/lswsctrl start

Step 4: Create a Site, Add SSL, Enable HTTP/3

Create a Production Listener and Virtual Host

  • Open https://your_server_ip:7080 and log in.
  • Go to Listeners and create an HTTP listener on 0.0.0.0:80; add a Virtual Host Mapping to your domain.
  • Create an HTTPS listener on 0.0.0.0:443; upload or reference your SSL cert and key, then map to the same vhost.
  • Under Virtual Hosts, set Document Root (for example, /var/www/yourdomain/public_html).

Get a Free Let’s Encrypt SSL Certificate

You can use acme.sh or Certbot. Example with acme.sh using a webroot (replace the domain and webroot accordingly):

curl https://get.acme.sh | sh -s email=admin@yourdomain.com
~/.acme.sh/acme.sh --issue -d yourdomain.com -d www.yourdomain.com -w /var/www/yourdomain/public_html

# Install cert to LiteSpeed paths
sudo mkdir -p /usr/local/lsws/conf/cert/yourdomain
~/.acme.sh/acme.sh --install-cert -d yourdomain.com \
  --key-file /usr/local/lsws/conf/cert/yourdomain/privkey.key \
  --fullchain-file /usr/local/lsws/conf/cert/yourdomain/fullchain.crt \
  --reloadcmd "systemctl reload lsws"

Back in WebAdmin, point the HTTPS listener or the vhost SSL settings to these certificate files and save. Reload LiteSpeed to apply.

Enable HTTP/2 and HTTP/3 (QUIC)

  • Server Configuration > Tuning: enable QUIC/HTTP3
  • Listener > SSL > Protocols: ensure HTTP/2 is enabled
  • Reload LiteSpeed and verify with curl or an HTTP/3 test tool

Step 5: Configure PHP (lsphp)

LiteSpeed uses LSAPI for PHP, which is faster than PHP-FPM in many scenarios. Ensure the external app points to your lsphp binary and that the script handler is set for .php.

  • External App: LSAPI App pointing to /usr/local/lsws/lsphp81/bin/lsphp (or your version)
  • Script Handler: .php > lsphp
  • Install common PHP modules: mysql, intl, xml, gd, curl, zip, mbstring, opcache
# Ubuntu/Debian modules (example)
sudo apt install -y lsphp81-{mysql,intl,xml,gd,curl,zip,mbstring,opcache}
sudo systemctl restart lsws

# RHEL/Alma/Rocky modules (example)
sudo dnf install -y lsphp81-{mysql,intl,xml,gd,curl,zip,mbstring,opcache}
sudo systemctl restart lsws

WordPress on LiteSpeed: Best Practices

  • Install the LiteSpeed Cache plugin (LSCache) and enable guest mode, object caching (Redis), and QUIC.cloud CDN if desired.
  • Permalinks: set Post name in WordPress and ensure .htaccess rewrite rules are active.
  • PHP version: run PHP 8.1/8.2 for speed and security; enable OPcache.
  • Security: restrict WebAdmin port 7080 to your IP using firewall rules.

Performance Tuning Tips

  • Workers: set LiteSpeed worker processes to match CPU cores (WebAdmin > Server Configuration > Tuning).
  • Compression: enable Brotli and Gzip for faster transfers.
  • Cache policies: use LSCache with appropriate TTLs; enable CSS/JS minify and HTTP/2 push (or preload hints).
  • Static file delivery: serve images, CSS, JS directly via LiteSpeed; use QUIC.cloud or a CDN for global reach.

Troubleshooting Common Issues

  • Port already in use: stop and disable Apache/Nginx, then restart LiteSpeed.
  • 403/404 with rewrites: ensure “Enable Rewrite” and “Auto Load from .htaccess” are on in vhost settings.
  • Admin not accessible: open port 7080 and use https://; consider IP restricting this port.
  • SELinux on RHEL: if needed, allow web network connections (e.g., setsebool -P httpd_can_network_connect 1).
  • PHP not detected: verify lsphp path and script handler mapping, then restart lsws.

Uninstall or Switch Back

If you need to remove OpenLiteSpeed or LSWS:

# Ubuntu/Debian
sudo systemctl stop lsws
sudo apt remove --purge -y openlitespeed lsws
sudo rm -rf /usr/local/lsws

# RHEL/Alma/Rocky/CentOS
sudo systemctl stop lsws
sudo dnf remove -y openlitespeed lsws
sudo rm -rf /usr/local/lsws

To switch back to Apache or Nginx, reinstall and re-enable your original web server, then bind to ports 80/443.

Real-World Notes from 12+ Years Managing Servers

  • OLS is fantastic for new deployments focused on WordPress speed. For existing Apache stacks or control panels, Enterprise is smoother.
  • Always secure WebAdmin (7080) by IP. It’s powerful; don’t leave it wide open.
  • QUIC/HTTP/3 yields noticeable gains on mobile networks. Enable it once SSL is live.
  • For WooCommerce, LSCache’s ESI is a game-changer on Enterprise.
  • Monitor logs in /usr/local/lsws/logs for quick diagnostics.

When to Use Managed LiteSpeed Hosting

If you prefer not to manage repos, SSL, and tuning yourself, a managed LiteSpeed plan can save hours. At YouStable, our LiteSpeed-powered hosting includes LSWS Enterprise, HTTP/3 by default, LSCache pre-configured, and 24/7 monitoring—ideal if you want the performance benefits without the sysadmin overhead.

FAQ’s: Install LiteSpeed on Linux Server

Is OpenLiteSpeed fast enough for WordPress?

Yes. OpenLiteSpeed with LSCache delivers excellent performance and supports HTTP/2/3. For complex Apache configurations, cPanel compatibility, or ESI, consider LiteSpeed Enterprise.

Which ports do I need to open for LiteSpeed?

Open TCP ports 80 (HTTP), 443 (HTTPS), and 7080 (WebAdmin). Open 8088 if you want to access the OpenLiteSpeed default test page. Restrict 7080 to your IP for security.

How do I enable HTTP/3 (QUIC) on LiteSpeed?

In WebAdmin, enable QUIC at Server Configuration > Tuning. Ensure your HTTPS listener is active with a valid certificate. Reload LiteSpeed and verify using a QUIC-capable browser or an HTTP/3 checker.

Can LiteSpeed replace Apache without downtime?

With Enterprise, you can read Apache configs and map vhosts to minimize disruption. Plan a maintenance window, stop Apache, start LSWS on 80/443, and test thoroughly before going live.

How do I add a Let’s Encrypt SSL certificate?

Use acme.sh or Certbot with the webroot method. Place cert/key paths in the HTTPS listener or vhost SSL settings and reload LiteSpeed. Automate renewals with the tool’s built-in cron.

Where is the LiteSpeed configuration stored?

The default path is /usr/local/lsws/ with configs in /usr/local/lsws/conf/. Logs are typically in /usr/local/lsws/logs/. Virtual host configs live under /usr/local/lsws/conf/vhosts/.

What’s the easiest way to host WordPress on LiteSpeed?

Install OLS or Enterprise, create a vhost, install lsphp, and add the LiteSpeed Cache plugin. If you prefer managed, YouStable’s LiteSpeed plans ship with LSCache, HTTP/3, and performance presets out of the box.

Conclusion

Now you know how to install LiteSpeed on Linux server platforms, configure PHP, secure the admin, add SSL, and tune performance. Start with OpenLiteSpeed for a free, fast stack, or choose LiteSpeed Enterprise for full Apache compatibility and advanced features. Either way, you’ll unlock top-tier speed and stability for modern websites and apps.

Alok Trivedi

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top