OpenLiteSpeed is a free and open-source web server software that enables users to deliver websites faster and reliably. This can be done in many ways, including concurrency, memory usage, request processing rates and built-in cache. OpenLiteSpeed has a large community dedicated to developers who contribute code and hardware to the project. OpenLiteSpeed is written in the C programming language and can be used on many platforms, including Linux, UNIX, BSD and Windows.

In this guide, we will walk you through the steps necessary to get OpenLiteSpeed up and running on your server. Plus, we will show you how to configure it for optimal performance. So let’s get started!

Prerequisites

In order to install and run OpenLiteSpeed on Ubuntu 20.04, you will need to have:

  • An available user to SSH in as root (on the server), with sudo privileges. You can learn how to create a user with sudo privileges here.
  • A VPS server running Ubuntu 20.04 x64 Server, in any location you’d like for your Linux server. You can set up DigitalOcean or Vultr in just a few minutes.

Updating Your Server Package Repository

It’s important to update your package repository before installing new software. To do this, use the following command. This command will download a list of available packages from your chosen Ubuntu server. If there are updates to existing software, it will download information about those too and update your local cache.

sudo apt update -y

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Installing OpenLiteSpeed on Ubuntu 20.04

Now that we have updated our package repository, let’s install OpenLiteSpeed.

You can Install OpenLiteSpeed from Binary File, Official Repository or Build from Source Files. This guide will use the OpenLiteSpeed repository shell script to install OpenLiteSpeed

A shell script is a file containing a series of commands which are executed by a UNIX-like operating system (Linux, FreeBSD, OS X). It’s called “script” because all it contains is text; there’s no specific extension required.

The openlitespeed repository is a shell script that downloads the OpenLiteSpeed source from the official site and add it to your repositories list automatically. It is a script written by users for users and it’s free. It’s available for Linux Operating System ONLY! Don’t try to use it on windows or other platforms because you will get errors.

Run the following command to download the OpenLiteSpeed repository shell script.

wget http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Run the enable_lst_debian_repo.sh script to download the GPG keys, etc. for the OpenLiteSpeed repositories to your server where you are installing LiteSpeed Web Server. This script downloads the GPG key, adds them to apt-key list and then installs predefined OpenLiteSpeed Debian repositories.

sudo bash enable_lst_debian_repo.sh

If everything goes OK, you should see something like this.Advertisement

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Finally, run the following command to install OpenLiteSpeed

sudo apt install openlitespeed -y

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Once the OpenLiteSpeed package installation is finished, you must start the OpenLiteSpeed service in order to begin managing your web server.

sudo systemctl start lsws

After OpenLiteSpeed is started on your server, you need to set an administrator username and password to enter the admin console. The username and password that you set up is the only way to log in to the admin console. It’s kind of like a digital door lock with a physical key.

Run the following command to set an administrator username and password.

sudo bash /usr/local/lsws/admin/misc/admpass.sh

This is a custom script that sets your OpenLiteSpeed administrator’s username and password. The file itself contains the following comments, which are also shown below. The /usr/local/lsws/admin/misc/admpass.sh (which is will be referred to as admpass.sh for the rest of this article) file helps make the installation process more secure, by requiring you to set an admin username and password after starting OpenLiteSpeed. OpenLiteSpeed is built with the “non-interactive” feature, which means you do not need to interact with it after installation. However, by having an admin username and password set initially, this helps prevent brute force attempts at trying random usernames and passwords until they get lucky enough to guess yours.

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Provide your own username and password. These should be complex and different from the root user’s password you’re setting for your server.

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Configuring Your Firewall

Now that we have installed and started OpenLiteSpeed on your server, it’s time to configure your firewall.

OpenLiteSpeed listens on 7080 and 8088 by default. It’s important to open up these ports in your firewall or your OpenLiteSpeed will show that the server is up and running, but inaccessible.

The easiest way to configure your firewall is via UFW (Uncomplicated Firewall). If you’re not familiar with this tool, don’t worry – it’s very simple.

Run the following command to open the ports that OpenLiteSpeed listens on.

sudo ufw allow 7080/tcp && sudo ufw allow 8088/tcp

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Your firewall is now configured and will be applied to the current session and saved for future sessions. To view your active firewall rules, run:

sudo ufw status verbose

Accessing OpenLiteSpeed Web UI

Now that our OpenLiteSpeed installation is complete, we can access it on the web via your web browser by following the instructions below.

Open your favorite web browser and go to the following address http://server-ip:7080/ where server-ip is the public IP address of your server.

You should be presented with OpenLiteSpeed’s main home page, as shown below.

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Accessing OpenLiteSpeed Web UI

Now that our OpenLiteSpeed installation is complete, we can access it on the web via your web browser by following the instructions below.

Open your favorite web browser and go to the following address http://server-ip:7080/ where server-ip is the public IP address of your server.

You should be presented with OpenLiteSpeed’s main home page, as shown below.

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Open another tab, this time, go to http://server-ip:7080 to access the admin console of OpenLiteSpeed. Enter the username and password that you set previously to log in.

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

You will see the OpenLiteSpeed Dashboard. This is where we will configure OpenLiteSpeed to run our web applications.

How to Install OpenLiteSpeed Web Server on Ubuntu 20.04 ubuntu

Conclusion

In this guide, we walked through the installation of OpenLiteSpeed on Ubuntu 20.04. We set up the firewall and then opened up the ports that OpenLiteSpeed listens on. We finished up by accessing the web interface and accessing your new admin console.