Skip to content
Follow
Ubuntu Linux

How to Install OpenLiteSpeed on Ubuntu Linux

Richard
Written by
Richard
Sep 11, 2021 Updated Sep 15, 2026 6 min read
How to Install VMware Workstation Player on Ubuntu Linux
How to Install VMware Workstation Player on Ubuntu Linux

OpenLiteSpeed is a free, high-speed web server that runs websites on Ubuntu Linux. It handles high traffic faster than Apache and includes a built-in web admin panel to help you manage your server settings.

Advertisement

Installing OpenLiteSpeed on Ubuntu takes only a few terminal commands and includes setup for PHP and MariaDB (a database system that stores your site data) so you can run platforms like WordPress.

⚡ Quick Answer

Install OpenLiteSpeed by adding its repository via `wget` and `bash`, then update your package list and install with `sudo apt update && sudo apt install openlitespeed`. Start and enable the service using `sudo systemctl start lshttpd` and `sudo systemctl enable lshttpd`.

Advertisement

How to install OpenLiteSpeed on Ubuntu from the repository

You can install OpenLiteSpeed on Ubuntu from the repository to get automatic updates and keep your web server secure with the latest patches. This method adds the official software source to your system so you do not need to update the web server manually. You just need to run a few commands in your terminal to set it up.

To add the repository, run the commands below:

wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | sudo bash

The above command will also import the OpenLiteSpeed GPG key to Ubuntu and activate it. You can then run the commands below to install OpenLiteSpeed.

sudo apt update
sudo apt install openlitespeed

After installing OpenLiteSpeed, the commands below can be used to stop, start and enable OpenLiteSpeed services to automatically startup when the server boots.

Advertisement
sudo systemctl stop lshttpd
sudo systemctl start lshttpd
sudo systemctl enable lshttpd

To see if the OpenLiteSpeed service is running, run the commands below.

sudo systemctl status lshttpd

That should output similar lines as shown below:

lshttpd.service - OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/lshttpd.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-09-11 17:43:24 CDT; 13s ago
   Main PID: 5773 (litespeed)
     CGroup: /system.slice/lshttpd.service
             ├─5773 openlitespeed (lshttpd - main)
             ├─5783 openlitespeed (lscgid)
             ├─5813 openlitespeed (lshttpd - #01)
             └─5814 lsphp

Sep 11 17:43:22 ubuntu2004 systemd[1]: Starting OpenLiteSpeed HTTP Server.
Sep 11 17:43:22 ubuntu2004 lswsctrl[5745]: [OK] litespeed: pid=5773.

How to configure OpenLiteSpeed on Ubuntu Linux

You can configure OpenLiteSpeed on Ubuntu Linux to use the standard web port 80 instead of the default port 8088 so visitors do not need to type a port number in their browser. Changing this setting requires editing the main configuration file directly in your terminal. This makes your website address much simpler for people to visit.

To do that, run the commands below to open its configuration file.

Advertisement
sudo nano /usr/local/lsws/conf/httpd_config.conf

Then look for the lines below and change the highlighted port from 8088 to 80.

listener Default{
    address                  *:80
    secure                   0
    map                      Example *
}

Save your changes and exit.

Restart OpenLiteSpeed by running the commands below.

sudo systemctl restart lshttpd

Now open your browser and browse to the server hostname or IP address. That should open the OpenLiteSpeed default web server welcome page.

Advertisement
http://localhost
OpenLiteSpeed default web server homepage on Ubuntu
openlitespeed default web server home
⚠️WarningWith the default, port changed to 80, run the commands below to set up the administrator password, which will be used to log on to the OpenLiteSpeed admin panel.
sudo /usr/local/lsws/admin/misc/admpass.sh

When you run the command above, it will prompt you to type in the admin username and create a password. The default username is admin. Leave blank to use it.

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: 

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password: 
Retype password: 
Administrator's username/password is updated successfully!

The admin panel can be accessed using the link below:

https://localhost:7080/login.php

Login using the admin login details above.

Advertisement
OpenLiteSpeed admin panel interface for server management
openlitespeed admin panel

How to install PHP 8.0 support for OpenLiteSpeed

You can install PHP 8.0 support for OpenLiteSpeed to give your website better speed, the latest features, and important security updates. Running a few commands in your terminal adds this PHP version and connects it to your web server. This helps your dynamic pages load much faster than older PHP releases.

The most recent stable release of PHP, version 8.0, provides performance improvements over previous versions. To install PHP 8.0 on Ubuntu Linux, execute the following specific commands in your terminal.

sudo apt install lsphp80 lsphp80-mysql lsphp80-common lsphp80-opcache lsphp80-curl

To make OpenLiteSpeed use PHP 8.0, log on to the admin panel, go to Server Configuration -> External App, and click the + button to add a new external app.

Updating PHP settings in OpenLiteSpeed on Ubuntu
openlitespeed php update

When prompted to choose the type of app you want to add, choose LiteSpeed SAPI App. Then click Next (arrow).

Advertisement
Configuring external application types in OpenLiteSpeed
openlitespeed type of external app

On the PHP configuration settings, use these recommended values:

Name: lsphp8.0
Address: uds://tmp/lshttpd/lsphp80.sock
Max Connections: 10
Environment: PHP_LSAPI_CHILDREN=10
LSAPI_AVOID_FORK=200M
Initial Request Timeout (secs): 60
Retry Timeout (secs): 0
Persistent Connection: Yes
Response Buffering: No
Command: lsphp80/bin/lsphp
Backlog: 100
Instances: 1
Priority: 0
Memory Soft Limit (bytes): 2047M
Memory Hard Limit (bytes): 2047M
Process Soft Limit: 1400
Process Hard Limit: 1500
PHP configuration settings in OpenLiteSpeed server
openlitespeed php configuration

Save your changes.

OpenLiteSpeed's Script Handler manages website code. To change Script Handler rules, open the Server Configuration menu, select Script Handler, and click Edit. Editing these rules lets you control how website code runs; for example, you can set a handler to use PHP version 8.1 for better performance.

Updating script handler settings in OpenLiteSpeed
openlitespeed script handler update

Then choose the new PHP 8.0 handler created above and save.

Advertisement
Changing PHP handler settings in OpenLiteSpeed
openlitespeed php handler change

Restart the server, then go to the server name or IP address followed by /phpinfo.php.

http://localhost/phpinfo.php

PHP 8.0 is now the default handler.

OpenLiteSpeed PHP 8 default configuration on Ubuntu
openlitespeed php 8 default

How to install MariaDB on Ubuntu Linux

You can install MariaDB on Ubuntu Linux using the package manager to set up a secure database for your websites and applications. Running the installation commands sets up both the server and client tools on your system. You can then manage the database service and make sure it starts automatically when your computer turns on.

sudo apt install mariadb-server
sudo apt install mariadb-client

After installing MariaDB, the commands below can stop, start and enable MariaDB services to start up when the server boots.

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
⚠️WarningNext, run the commands below to secure the database server with a root password if you were not prompted to do so during the installation.
sudo mysql_secure_installation

When prompted, use the guide below to answer:

If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none): PRESS ENTER

Switch to unix_socket authentication [Y/n] n

Change the root password? [Y/n] n

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

All done!

To verify and validate that MariaDB is installed and working, log in to the database console using the commands below:

sudo mysql -u root -p

You should automatically be logged in to the database server since we initiated the login request as root. Only the root can log in without a password and from the server console.

mariadb welcome
mariadb ubuntu 1604

The server was successfully installed if you see a similar screen.

That should do it!

Conclusion:

This guide demonstrated how to install OpenLiteSpeed, which supports PHP 8.0 and MariaDB. You can use the comment form below to report errors or add information about the OpenLiteSpeed installation.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Advertisement

📚 Related Tutorials

How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux
Install WordPress on Ubuntu with OpenLiteSpeed
CMS Install WordPress on Ubuntu with OpenLiteSpeed
How to Install PHP on Ubuntu Linux
Ubuntu Linux How to Install PHP on Ubuntu Linux
How to Reset MySQL Root Password on Ubuntu
Ubuntu Linux How to Reset MySQL Root Password on Ubuntu

3 Comments

Leave a Comment

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