How to install Open LiteSpeed Web Server on Ubuntu 22.04?

Overview

OpenLiteSpeed Web Server is an easy-to-use open-source version of LiteSpeed. It provides your sites with unrivaled functionality, performance, and top-tier security. The server recognizes all Apache rewrite rules and has sophisticated cache acceleration capabilities that allow you to install the quickest caching on your server.

This tutorial will show you how to install the Open LiteSpeed Web Server on Ubuntu 22.04 and how to access the Open LiteSpeed dashboard.

Prerequisites

There are certain prerequisites that need to be met before you begin.

  • Server with Ubuntu 22.04

  • Non-root user (sudo-enabled)

Key

  • Red Color: Input

  • Green Color: Output

Common prompts

  • Every time you use sudo before a command as a non-root user, you can be prompted for your user password in order to execute the command.

  • When a command is executed, you could be asked if you wish to carry it out further or not. Enter "Y" to proceed or "n" to end, and then press ENTER.

Get Started

Step 1: OpenLiteSpeed and PHP 8.1 Installation

Let's begin by updating and upgrading the packages present on your server.

i. Run the below command to fetch the package information from all configured sources.

sudo apt-get update

ii. Run the below command to download and install the package fetched above.

sudo apt-get upgrade

iii. Use the following command to add the OpenLiteSpeed Ubuntu repository to your server.

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

iv. Once you’ve added the OpenLiteSpeed repository, now you can install PHP 8.1 with the below command:

sudo apt install openlitespeed lsphp81

After setting up the OpenLiteSpeed web server, let's protect it by generating an administrator credential.

Step 2: Create a Username and Password

We must now create a new admin username and password for the OpenLiteSpeed web server.

Move to your default directory to create the credential using the below command:

cd /usr/local && cd lsws/admin && cd misc

Run the below command to execute the script, which will help you create a new admin credential.

sudo ./admpass.sh

You'll be prompted to enter a username. If you proceed further without first creating a username, then "admin" is your default username. You are free to set whatever username you want.

The account will then be required to establish a password. Enter your preferred administrative password and press Enter. Then retype the password and hit Enter again.

Step 3: Accessing the Dashboard

OpenLiteSpeed will run immediately after installation. You can see if lsws service has launched or not using the command shown below:

sudo service lsws status

As shown in the below screenshot, an active (running) response shows that the OpenLiteSpeed web server is now running.

Use the following command to start your lsws service if it hasn't already started.

sudo service lsws start

You can now access the OpenLiteSpeed Dashboard by navigating to https://<Sever IP>:7080. Enter your username and password created in Step 2.

Note: The default port number is 7080, but you may modify it via the OpenLiteSpeed dashboard.

Once authorized, you will be redirected to the OpenLiteSpeed administrator portal.

Last updated