---
title: How to Install OpenLiteSpeed Webserver on Debian 12
url: https://docs.vultr.com/how-to-install-openlitespeed-webserver-on-debian-12
description: Learn how to install OpenLiteSpeed webserver on Debian 12 with our step-by-step guide. Boost your website performance with this lightweight, high-speed server solution.
publish_date: 2024-09-20T12:27:10.716273Z
last_updated: 2025-04-01T00:00:00Z
author: Abraham Dahunsi
header_image: https://docs.vultr.com/public/doc-assets/1934/a401679d-d9a4-4672-8d84-673c6e20810b.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

## Introduction

OpenLiteSpeed is a lightweight, high-performance, open-source webserver that delivers web applications using modern web technologies. The webserver supports built-in caching, HTTP/3, and a graphical web console for simplified server management.

In this article, you'll install the OpenLiteSpeed webserver on Debian 12, access the web console, and create virtual hosts to serve web applications.

## Prerequisites

Before you begin:

* Deploy a [Debian 12 instance on Vultr](https://www.vultr.com/servers/debian).
* Access the instance using SSH as a non-root user with sudo privileges.
* Set up a new [domain A record pointing to the instance's public IP address](https://docs.vultr.com/introduction-to-vultr-dns).
* [Update the instance](https://docs.vultr.com/how-to-update-a-vultr-cloud-server#how-to-update-debian-&-ubuntu).

## Install OpenLiteSpeed

OpenLiteSpeed is not available in the default package repositories on Debian 12. Follow the steps below to download the latest OpenLiteSpeed repository information script and install the application.

1. Download and run the OpenLiteSpeed repository setup script.

    ```console
    $ wget -O - https://repo.litespeed.sh | sudo bash
    ```

    Output:

    ```
    LiteSpeed repository has been setup!
    ```

1. Install the OpenLiteSpeed package.

    ```console
    $ sudo apt install openlitespeed -y
    ```

1. View the installed OpenLiteSpeed version.

    ```console
    $ cat /usr/local/lsws/VERSION
    ```

    Output:

    ```
    1.7.19
    ```

## Manage the OpenLiteSpeed System Service

OpenLiteSpeed uses the `lsws` system service to run on the server and manage the application processes. Follow the steps below to enable the OpenLiteSpeed system service to start at boot time and manage the webserver processes.

1. Enable OpenLiteSpeed to automatically start at boot.

    ```console
    $ sudo systemctl enable lsws
    ```

1. Start the OpenLiteSpeed service.

    ```console
    $ sudo systemctl start lsws
    ```

1. View the OpenLiteSpeed service status and verify that it's running.

    ```console
    $ sudo systemctl status lsws
    ```

    Output:

    ```
    ● lsws.service - LSB: lshttpd
         Loaded: loaded (/etc/init.d/lsws; generated)
         Active: active (running) since Wed 2024-08-14 21:43:25 UTC; 2min 48s ago
           Docs: man:systemd-sysv-generator(8)
          Tasks: 3 (limit: 2224)
         Memory: 6.4M
            CPU: 462ms
         CGroup: /system.slice/lsws.service
                 ├─2314 openlitespeed (lshttpd - main)
                 ├─2323 openlitespeed (lscgid)
                 └─2352 openlitespeed (lshttpd - #01)
    ```

1. Stop OpenLiteSpeed.

    ```console
    $ sudo systemctl stop lsws
    ```

1. Restart OpenLiteSpeed.

    ```console
    $ sudo systemctl reload lsws
    ```

## Configure OpenLiteSpeed

OpenLiteSpeed includes an administrator setup script that lets you create administrative users to manage the webserver using the web console interface. Follow the steps below to create a new user and configure OpenLiteSpeed to listen for web application requests on the HTTP port `80`.

1. Run the OpenLiteSpeed administrator script to create a new user account.

    ```console
    $ sudo bash /usr/local/lsws/admin/misc/admpass.sh
    ```

    Enter a new administrative username and a strong password.

    Output:

    ```
    Administrator's username/password is updated successfully!
    ```

1. Allow incoming connections to the OpenLiteSpeed web console port `7080` through the firewall.

    ```console
    $ sudo ufw allow 7080/tcp
    ```

1. Reload the firewall to apply the new connection rules.

    ```console
    $ sudo ufw reload
    ```

1. Access the OpenLiteSpeed web console on port `7080` using your server IP in a web browser such as Chrome.

    ```
    http://SERVER-IP:7080
    ```

1. Accept the insecure certificate warning.

    ![Accept the Insecure Certificate Warning](https://docs.vultr.com/public/doc-assets/1934/5693b58d-6324-4a8c-a8fa-3c249285f764.png)

1. Log in to the OpenLiteSpeed Web control panel using the administrative user and password you created earlier.

    ![Enter the Administrator Username and Password](https://docs.vultr.com/public/doc-assets/1934/5f2cb8b6-f1ac-408d-8495-6ce5c8c04220.png)

1. Click **Listeners** on the left navigation menu.

    ![Click Listeners on the Left Navigation Menu](https://docs.vultr.com/public/doc-assets/1934/31da3b34-6e84-453f-b77f-38305dc79b68.png)

1. Click **View** within the **Actions** section of the **Default listener**.

    ![Click View within the Actions Section](https://docs.vultr.com/public/doc-assets/1934/489fe115-f9ee-4afb-b953-83f3204ed325.png)

1. Click **Edit** within the **Address Settings** section.
1. Change the **Port** value from `8088` to `80`.

    ![Chnage Port Value from 8088 to 80](https://docs.vultr.com/public/doc-assets/1934/14d9e4e4-caaf-42ee-820a-a286ac3c447b.png)

1. Click **Save** to apply the listening address changes.
1. Click **Graceful Restart** to apply the webserver configuration changes.

    ![Click Graceful-Restart to Apply the Changes](https://docs.vultr.com/public/doc-assets/1934/cae5b026-ec30-4db0-8894-ad247f720a2a.png)

## Create a New OpenLiteSpeed Virtual Host

OpenLiteSpeeds supports multiple virtual hosts that use a unique domain, document root, and delivery directives. Follow the steps below to create a new OpenLiteSpeed virtual host for the `app.example.com` domain.

1. Create a web directory for your virtual host.

    ```console
    $ sudo mkdir /usr/local/lsws/app.example.com
    ```

1. Create the OpenLiteSpeed data sub-directories.

    ```console
    $ sudo mkdir /usr/local/lsws/app.example.com/{html,logs,conf} -p
    ```

    The above command creates the following sub-directories in your web root directory:

    * `html`: Contains the web application files served by OpenLiteSpeed.
    * `logs`: Stores the virtual host's access and error logs.
    * `conf`: Stores site-specific OpenLiteSpeed configurations.

1. Grant the `lsadm` OpenLiteSpeed user and group ownership privileges to the directory.

    ```console
    $ sudo chown lsadm:lsadm -R /usr/local/app.example.com 
    ```

1. Access the OpenLiteSpeed web console in a new web browser window.

    ```
    http://SERVER-IP:7080
    ```

1. Click **Virtual Hosts** on the left navigation menu.

    ![Click Virtual Hosts on the Left Menu](https://docs.vultr.com/public/doc-assets/1934/2bb19a59-f89f-4711-b1a9-d2e057f6a490.png)

1. Click Add **+** to create a new virtual host with the following information:

    * Virtual Host Name: `app.example.com`
    * Virtual Host Root: `$SERVER_ROOT/app.example.com/`
    * Config File: `$SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf`
    * Follow Symbolic Link: `Yes`
    * Enable Scripts/ExtApps: `Yes`
    * Restrained: `Yes`
    * External App Set UID Mode: `Server UID`

1. Click **Save** to create the new virtual host.

    ![Click Save to Create the New Virtual Host](https://docs.vultr.com/public/doc-assets/1934/5767f430-506f-4dfc-8867-e0c8b200cf39.png)

1. Click **CLICK TO CREATE** when prompted to create the new virtual host configuration file `usr/local/lsws/conf/vhosts/app.example.com/vhconf.conf`.
1. Click **Save** to apply the virtual host configuration.
1. Navigate to **Virtual Hosts** and select **app.example.com**.

    ![Navigate to Virtual Hosts and Select your Domain](https://docs.vultr.com/public/doc-assets/1934/698b659b-9a64-4956-94e1-3b8039c2210e.png)

1. Navigate to the **General** tab and click **Edit** to modify the new virtual host configuration with the following information:

    * Document Root: `$VH_ROOT/html/`
    * Domain Name: `app.example.com`
    * Domain Aliases: `app.example.com`
    * Enable GZIP Compression: `Yes`
    * Enable Brotli Compression: `Yes`

1. Click **Save** to apply the new virtual host configurations.

    ![Click Save to Apply the new Virtual Host](https://docs.vultr.com/public/doc-assets/1934/4805f51f-37cb-4ed9-81e5-a7accf8e7313.png)

1. Navigate to the **Log** tab and click **Edit** in the **Virtual Host Log** section to update the following fields:

    * Use Server's Log: `Yes`
    * File Name: `$VH_ROOT/logs/error.log`
    * Log Level: `ERROR`
    * Rolling Size (bytes): `10M`
    * Keep Days: `30`

    ![Virtual Host Error Log](https://docs.vultr.com/public/doc-assets/1934/0cfcd6e4-c6c7-439e-a931-30119023f07b.png)

1. Click **Save** to apply the log changes.
1. Click **Add** within the **Access Log** section and modify the following fields:

    * Log Control: `Own Log File`
    * File Name: `$VH_ROOT/logs/access.log`
    * Rolling Size (bytes): `10M`
    * Keep Days: `30`

1. Click **Save** to apply the log configurations.

    ![Click Save to Apply the Log Configurations](https://docs.vultr.com/public/doc-assets/1934/3b26eac7-f64f-49b9-b3ed-c11330e2c672.png)

1. Navigate to the **Rewrite** tab, click **Edit** in the **Rewrite Control** section and update the following fields:

    * Enable Rewrite: `Yes`
    * Auto Load from .htaccess: `Yes`

1. Click **Save** to apply the rewrite configurations.

    ![Rewrite the Configurations](https://docs.vultr.com/public/doc-assets/1934/45f409b2-3be4-440a-8196-3a182daa4956.png)

1. Click **Listeners** on the left navigation menu and select **Default** > **Virtual Host Mappings**.
1. Click **Add** and map the `app.example.com` domain to the virtual host you created earlier with the following values:

    * Virtual Host: `app.example.com`
    * Domains: `app.example.com`

    ![Map the domain to the Virtual Host](https://docs.vultr.com/public/doc-assets/1934/b40aee0e-9fa0-453b-bf71-15e66a89bc98.png)

1. Click **Save** to apply the virtual host changes and click **Graceful Restart** in the top right corner to apply the webserver configurations.

    ![Click Graceful Restart to Apply the Changes](https://docs.vultr.com/public/doc-assets/1934/cae5b026-ec30-4db0-8894-ad247f720a2a.png)

1. Create a new `index.html` web application file in your virtual host's `html` directory.

    ```console
    $ sudo nano /usr/local/lsws/app.example.com/html/index.html
    ```

1. Add the following contents to the file.

    ```html
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Test Page</title>
        <style>
            body {
                display: flex;
                justify-content: center;
                align-items: center;
                height: 100vh;
                margin: 0;
            }
        </style>
    </head>
    <body>
        <h1>Hello World! Greetings from Vultr</h1>
    </body>
    </html>
    ```

    Save and close the file.

    The above HTML application displays a `Hello World! Greetings from Vultr` message when you access it using your virtual host domain.

1. Allow network connections to the HTTP port `80` through the firewall.

    ```console
    $ sudo ufw allow 80/tcp
    ```

1. Access your domain using a web browser such as Chrome.

    ```
    http://app.example.com
    ```

1. Verify that OpenLiteSpeed serves your web application files.

    ![Sample Web Application](https://docs.vultr.com/public/doc-assets/1934/28cac444-03b5-4009-b8dd-2ab12de36667.png)

## Secure the OpenLiteSpeed Webserver

OpenLiteSpeed serves web content using the insecure HTTP port `80` by default, which allows plain text data transmission between HTTP clients and the webserver. To encrypt sensitive information on port `443`, enable HTTPS using trusted SSL/TLS certificates. Follow the steps below to generate trusted SSL certificates and secure the OpenLiteSpeed webserver.

1. Install the Certbot Let's Encrypt client tool.

    ```console
    $ sudo apt install certbot
    ```

1. Generate a new SSL certificate for your domain. Replace `app.example.com` with your actual domain name and `admin@example.com` with your email address.

    ```console
    $ sudo certbot certonly --webroot -w /usr/local/lsws/app.example.com/html/ --staple-ocsp --preferred-challenges http -m admin@example.com -d app.example.com --agree-tos
    ```

    Output:

    ```
    Successfully received certificate.
    Certificate is saved at: /etc/letsencrypt/live/app.example.com/fullchain.pem
    Key is saved at:         /etc/letsencrypt/live/app.example.com/privkey.pem
    This certificate expires on 2024-11-14.
    These files will be updated when the certificate renews.
    Certbot has set up a scheduled task to automatically renew this certificate in the background.
    ```

1. Access the OpenLiteSpeed web console.

    ```
    http://SERVER-IP:7080 
    ```

1. Click **Listeners** on the main navigation menu.
1. Click Add **+** to create a new listener and set the following values:

    * Listener Name: `SSL Listener`
    * IP Address: `ANY IPv4`
    * Port: `443`
    * Secure: `Yes`

    ![Create New Listener](https://docs.vultr.com/public/doc-assets/1934/0767c1ed-70cc-406a-819a-d39b7533ba95.png)

1. Click the **Save** to apply changes.
1. Click **View** within the **Listeners** section to modify the new SSL Listener.

    ![View the SSL Listener](https://docs.vultr.com/public/doc-assets/1934/5ee673cc-3cf4-4ff1-ae79-e8a51b9d960d.png)

1. Click **Add** to bind the listener to your existing virtual host in the **Virtual Host Mappings** section with the following values.

    * Virtual Host: `app.example.com`
    * Domains: `app.example.com`

    ![Modify the SSL Listener](https://docs.vultr.com/public/doc-assets/1934/21416b95-25f9-4821-8161-3ee3d46400c2.png)

1. Click **Save** to apply the configuration changes.
1. Navigate to the **SSL** tab within the SSL Listener settings.
1. Click **Edit** in the **SSL Private Key & Certificate** section and update the following fields with your Let's Encrypt certificate paths.

    * Private Key File: `/etc/letsencrypt/live/app.example.com/privkey.pem`
    * Certificate File: `/etc/letsencrypt/live/app.example.com/fullchain.pem`
    * Chained Certificate: `Yes`

    ![Set SSL Certificate Paths](https://docs.vultr.com/public/doc-assets/1934/281f19e9-b60e-47b9-931c-1ff33cad5906.png)

1. Click **Save** to apply the SSL changes and select **Graceful Restart** in the top right corner to apply the webserver configurations.

    ![Restart LSWS](https://docs.vultr.com/public/doc-assets/1934/18aeaab8-250b-4b7f-bf46-fd040cfe608a.png)

## Set Up Firewall Rules

OpenLiteSpeed web console runs on port `7080` and serves web applications on HTTP port `80` and HTTPS port `443`. Follow the steps below to allow HTTP and HTTPS network connections through the firewall.

1. View the UFW status and verify that it's active.

    ```console
    $ sudo ufw status
    ```

    Output:

    ```
    Status: active
    ```

1. Allow HTTP connections on Port `80`.

    ```console
    $ sudo ufw allow 80/tcp
    ```

1. Allow HTTPS connections on Port `443`.

    ```console
    $ sudo ufw allow 443/tcp
    ```

1. View the UFW status and verify that the new rules are available.

    ```console
    $ sudo ufw status
    ```

1. Reload UFW to apply the firewall changes.

    ```console
    $ sudo ufw reload
    ```

1. Access your domain using a web browser and verify that your application displays correctly.

    ```
    https://app.example.com
    ```

    ![Access the Greetings from Vultr Virtual Host Web Application](https://docs.vultr.com/public/doc-assets/1934/e56d9cb0-2b8e-41e9-a1ab-cae60a6ed814.png)

## Conclusion

You have installed the OpenLiteSpeed webserver on Debian 12 and enabled access to the web console administration interface. OpenLiteSpeed supports multiple virtual hosts you can use to securely run web applications with different frameworks on your server. For more information, please visit the [official OpenLiteSpeed documentation](https://docs.openlitespeed.org/).
