LiteSpeed

Install OpenLiteSpeed on Ubuntu or AlmaLinux

Install the free OpenLiteSpeed web server with LSPHP from the LiteSpeed repository, secure the WebAdmin console, create a virtual host and enable LSCache-ready PHP.

IntermediateLinux VPS3 min read

OpenLiteSpeed is the free, open-source edition of the LiteSpeed web server. It is event-driven, runs PHP through the fast LSAPI interface and works with the LSCache plugins for WordPress and other apps. This guide installs OpenLiteSpeed on a self-managed VPS and sets up your first site.

Before you start

  • A clean Ubuntu 22.04/24.04 or AlmaLinux/Rocky 8/9 VPS with root access. Do not install it next to Apache or Nginx on ports 80/443.
  • A domain pointing to the server.
  • Firewall access to ports 80, 443 and 7080 (WebAdmin – restrict this to your own IP if you can).

Note: On MdmHost cPanel hosting you already run LiteSpeed Enterprise, so you do not need OpenLiteSpeed. This guide is for your own VPS.

Add the LiteSpeed repository

  1. Run the official repository script as root:
    wget -O - https://repo.litespeed.sh | sudo bash

Install OpenLiteSpeed and PHP

  1. On Ubuntu:
    sudo apt install -y openlitespeed lsphp83 lsphp83-common lsphp83-mysql lsphp83-curl lsphp83-intl lsphp83-opcache
  2. On AlmaLinux/Rocky:
    sudo dnf install -y openlitespeed lsphp83 lsphp83-common lsphp83-mysqlnd lsphp83-intl lsphp83-opcache
  3. Start the service:
    sudo systemctl enable --now lsws

Use a newer PHP package name (for example lsphp84) if your application supports it.

Set the WebAdmin password

  1. Run the admin password script:
    sudo /usr/local/lsws/admin/misc/admpass.sh
  2. Open https://your-server-ip:7080, accept the self-signed certificate warning and log in.

Point the server at your PHP version

  1. In WebAdmin go to Server Configuration → External App and edit the LSAPI app.
  2. Set Command to lsphp83/bin/lsphp (matching the version you installed) and save.

Create a virtual host

  1. Create the document root: sudo mkdir -p /var/www/example.com/html.
  2. In WebAdmin go to Virtual Hosts → Add. Set name example.com, Virtual Host Root /var/www/example.com/, Config File $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf, and enable scripts. Save and let it create the config file.
  3. Open the new host, go to General and set Document Root to $VH_ROOT/html/.
  4. Under Rewrite, enable rewrites and set Auto Load from .htaccess to Yes.
  5. Go to Listeners, open the Default listener (port 80) and add a mapping from the virtual host to example.com, www.example.com.
  6. Click Graceful Restart at the top right.

Add HTTPS

  1. Get a certificate with Certbot in webroot mode: sudo certbot certonly --webroot -w /var/www/example.com/html -d example.com -d www.example.com.
  2. Add a listener on port 443 with Secure set to Yes, point the private key and certificate to the files under /etc/letsencrypt/live/example.com/, map your virtual host and graceful restart.

Troubleshooting

  • Can't open port 7080: open it in the firewall, or reach it through an SSH tunnel.
  • .htaccess changes ignored: OpenLiteSpeed reads rewrite rules on restart; do a graceful restart after editing.
  • PHP shows as text or 503: the External App command path does not match an installed lsphp version.
  • Logs: check /usr/local/lsws/logs/error.log.

FAQ: OpenLiteSpeed

What is the difference between OpenLiteSpeed and LiteSpeed Enterprise?

Enterprise is paid, reads .htaccess live and integrates with cPanel, Plesk and DirectAdmin. OpenLiteSpeed is free, uses its own WebAdmin and reads rewrite rules only on restart.

Does LSCache work on OpenLiteSpeed?

Yes, the LSCache module is included and works with the LiteSpeed Cache plugin for WordPress.

Can I use OpenLiteSpeed with a control panel?

Some panels such as CyberPanel are built around it, but cPanel requires Apache or LiteSpeed Enterprise.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.