LiteSpeed Web Server is a high-performance, drop-in replacement for Apache that also competes with Nginx. OpenLiteSpeed (the open-source edition) offers HTTP/3, built-in caching, and native PHP support via LSAPI. This guide covers deploying OpenLiteSpeed on your VPS as an alternative to Nginx.
Install OpenLiteSpeed
# One-line installer
wget https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh
sudo bash ols1clk.sh --lsphp 83 # Install with PHP 8.3
# Or manual installation
sudo wget -O - https://repo.litespeed.sh | sudo bash
sudo apt install openlitespeed lsphp83 lsphp83-common lsphp83-mysql \
lsphp83-curl lsphp83-imagick lsphp83-imap lsphp83-intl
# Start OpenLiteSpeed
sudo systemctl start lsws
sudo systemctl enable lsws
# Default ports:
# Web: port 8088
# Admin panel: port 7080
# Set admin password
sudo /usr/local/lsws/admin/misc/admpass.sh
Configure Virtual Hosts
# Via web admin panel (https://your-ip:7080)
# Or edit configuration files directly
# /usr/local/lsws/conf/httpd_config.conf
listener Default {
address *:80
secure 0
}
listener SSL {
address *:443
secure 1
keyFile /etc/letsencrypt/live/example.com/privkey.pem
certFile /etc/letsencrypt/live/example.com/fullchain.pem
}
virtualHost example.com {
vhRoot /var/www/example.com
configFile conf/vhosts/example.com/vhconf.conf
allowSymbolLink 1
enableScript 1
}
# /usr/local/lsws/conf/vhosts/example.com/vhconf.conf
docRoot $VH_ROOT/html/
enableGzip 1
enableBr 1
context / {
location $VH_ROOT/html/
allowBrowse 1
rewrite {
enable 1
rules