How To Install OpenLiteSpeed on Debian 12
In this tutorial, we will show you how to install OpenLiteSpeed on Debian 12. OpenLiteSpeed is a high-performance, open-source web server designed to serve web content efficiently. It’s known for its speed, low resource usage, and robust security features. Unlike other web servers, OpenLiteSpeed is exceptionally user-friendly and easy to configure.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the OpenLiteSpeed web server on a Debian 12 (Bookworm).
Prerequisites
- A server running one of the following operating systems: Debian 12 (Bookworm).
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- Make sure your Debian 12 system is connected to the internet. An active connection is essential for downloading the required packages and updates during the installation.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install OpenLiteSpeed on Debian 12 Bookworm
Step 1. Start by ensuring your system is up-to-date. Open the terminal and execute the following commands:
sudo apt update sudo apt upgrade
Step 2. Installing OpenLiteSpeed on Debian 12.
To install OpenLiteSpeed, you need to add the OpenLiteSpeed repository to your Debian 12 system. Execute these commands:
wget -O - https://repo.litespeed.sh | sudo bash
Now, it’s time to install OpenLiteSpeed. Run the following command:
sudo apt install openlitespeed
Once the installation is complete, start OpenLiteSpeed using:
sudo systemctl start lsws
To ensure OpenLiteSpeed starts automatically at boot:
sudo systemctl enable lsws
Step 3. Installing PHP.
OpenLiteSpeed does not come with PHP by default, so you need to install PHP separately. PHP 8 can be installed using the following command:
sudo apt install lsphp81 lsphp81-common lsphp81-curl lsphp81-mysql lsphp81-opcache lsphp81-imap lsphp81-opcache
Step 4. Create the Administrator Password.
Creating an administrator password for OpenLiteSpeed can be done through the command line. Here’s a step-by-step guide to accomplish this:
sudo /usr/local/lsws/admin/misc/admpass.sh
Output:
Please specify the user name of administrator. This is the user name required to login the administration Web interface. User name [admin]: meilana 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!
For detailed information on controlling the server processes, please see the Administration Guide.
Step 5. Configure Firewall.
Securing OpenLiteSpeed with a firewall on Debian Linux involves using a tool like ufw
(Uncomplicated Firewall) to control incoming and outgoing network traffic. If UFW isn’t already installed on your Debian system, you can install it using the following command:
sudo apt install ufw
To permit incoming connections on port 7080 for OpenLiteSpeed’s management interface, use the following command:
sudo ufw allow 7080/tcp
Check the rules you’ve set up to confirm that only port 7080 is allowed:
sudo ufw status
After setting up the rules, reload ufw
to apply the changes:
sudo ufw reload
Step 6. Accessing OpenLiteSpeed Web UI.
You can access the OpenLiteSpeed web administration interface via your web browser. Simply enter your server’s IP address followed by port 7080. For example, http://your_server_ip:7080
.
Provide the login credentials set above and proceed to the OpenLiteSpeed dashboard.
Congratulations! You have successfully installed OpenLiteSpeed. Thanks for using this tutorial to install the latest version of the OpenLiteSpeed web server on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official OpenLiteSpeed website.