How to Install OpenLiteSpeed on Ubuntu Linux
OpenLiteSpeed is a fast, free web server that you can install on Ubuntu Linux using a simple script.
It’s a great alternative to other web servers like Apache or Nginx, especially if you want your website to load quicker. OpenLiteSpeed comes with a helpful web-based control panel that makes managing your website settings easy.
This tutorial shows you how to install OpenLiteSpeed, often version 1.7.x or a newer one, on your Ubuntu computer. You’ll also learn to connect it with PHP 8.0 and MariaDB, which are needed to run popular tools like WordPress.
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`.
How to install OpenLiteSpeed on Ubuntu from the repository
Installing OpenLiteSpeed on Ubuntu using its official software source ensures you get automatic updates. This method is the easiest way to install OpenLiteSpeed on Ubuntu, keeping your server secure with the latest patches without manual effort. You just need to run a couple of commands in your terminal to add the source and start the process.
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.
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
Configuring OpenLiteSpeed on Ubuntu to use the standard web port 80 instead of the default 8088 makes visiting your website simpler for everyone. They won’t need to type a port number. To make this important change, you’ll edit a specific configuration file directly from your terminal using a simple command.
To do that, run the commands below to open its configuration file.
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.
http://localhost

sudo /usr/local/lsws/admin/misc/admpass.sh
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.

How to install PHP 8.0 support for OpenLiteSpeed
Adding PHP 8.0 support to OpenLiteSpeed on Ubuntu gives your website the latest features and security updates, improving performance. This recent version offers better speed than older PHP versions, helping your site run faster. You can install PHP 8.0 and make it work with OpenLiteSpeed by running a few commands in your terminal.
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.

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

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

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.

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

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.

How to install MariaDB on Ubuntu Linux
Installing MariaDB, a popular and secure database for Linux, on your Ubuntu system is straightforward using the apt command. After installing both the server and client packages, you can easily manage the MariaDB service. This includes starting, stopping, and ensuring it begins automatically whenever your computer starts up.
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
Next, 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.

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?
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.
Current, December 12 2025 PHP is now
PHP logo
PHP Version 8.3.28
you should modify the php installation commands accordingly
[…] How to Install OpenLiteSpeed on Ubuntu Linux – Website for Students […]
[…] How to Install OpenLiteSpeed on Ubuntu Linux – Website for Students […]