Install OpenLiteSpeed on VPS — Faster Web Server than Nginx
OpenLiteSpeed (OLS) is the open-source version of LiteSpeed Enterprise — a web server that benchmarks show is 40x faster than Nginx for WordPress using LiteSpeed Cache. It supports HTTP/2, HTTP/3 (QUIC), LiteSpeed PHP (faster than PHP-FPM), automatic SSL via Let's Encrypt, and includes a WebAdmin Console for browser-based management without editing config files. This tutorial covers installing OLS, setting up Virtual Hosts, and configuring WordPress with LiteSpeed Cache.
Comparing OpenLiteSpeed with Nginx and Apache
- PHP Performance: LSPHP (OLS's PHP handler) is faster than PHP-FPM because of persistent connections to PHP processes
- Static Files: Equivalent to Nginx — much better than Apache
- WordPress: Combined with LiteSpeed Cache plugin, noticeably faster than Nginx + FastCGI Cache
- Drawbacks: Smaller ecosystem than Nginx, fewer modules, fewer tutorials available
- Best For: VPS running WordPress or PHP applications where maximum performance is required
Install OpenLiteSpeed on Ubuntu 22.04
# Add LiteSpeed repository
wget -O - https://repo.litespeed.sh | bash
# Install OpenLiteSpeed
apt install -y openlitespeed
# Install PHP 8.3 (LSPHP)
apt install -y lsphp83 lsphp83-common lsphp83-mysql lsphp83-curl lsphp83-json lsphp83-opcache lsphp83-mbstring lsphp83-xml lsphp83-zip lsphp83-imagick
# Start service
systemctl enable lsws
systemctl start lsws
# Check ports in use
# WebAdmin console: port 7080
# HTTP: port 8088 (default, must be changed to 80)
ss -tlnp | grep -E '7080|8088'
Configure Admin Password and WebAdmin Console
# Set WebAdmin password
/usr/local/lsws/admin/misc/admpass.sh
# Configure firewall to access WebAdmin temporarily
ufw allow 7080/tcp
# Open WebAdmin: https://YOUR_VPS_IP:7080
# Accept SSL warning (self-signed certificate)
# Log in with admin and the password you set
# Change HTTP listener from port 8088 to 80:
# Listeners → View → Default → Edit → Address: 80
# Close port 7080 when finished
# ufw delete allow 7080/tcp
Create Virtual Host for Your Domain
# Create directory structure
mkdir -p /var/www/example.com/{html,logs,conf}
# Via WebAdmin Console:
# Virtual Hosts → Add → Fill in details
# Virtual Host Name: example.com
# Virtual Host Root: /var/www/example.com/
# Config File: /var/www/example.com/conf/vhconf.conf
# Or create config directly (for advanced users)
cat > /var/www/example.com/conf/vhconf.conf << 'EOF'
docRoot /var/www/example.com/html
enableGzip 1
enableBr 1
errorlog /var/www/example.com/logs/error.log {
useServer 0
logLevel ERROR
rollingSize 10M
}
accesslog /var/www/example.com/logs/access.log {
useServer 0
rollingSize 10M
}
index {
useServer 0
indexFiles index.php, index.html
}
scripthandler {
add lsapi:lsphp83 php
}
rewrite {
enable 1
rules <<
Install WordPress with LiteSpeed Cache
# Install MariaDB
apt install -y mariadb-server
mysql_secure_installation
# Create database
mysql -u root -p -e "CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'SECURE_PASS';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;"
# Download WordPress
cd /var/www/example.com/html
curl -sO https://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz --strip-components=1
rm latest.tar.gz
chown -R nobody:nogroup /var/www/example.com/html
# In WordPress admin, install plugin:
# "LiteSpeed Cache" — official plugin with best OLS integration
# Go to LiteSpeed Cache → Cache → Enable Cache
# Set up Crawler in LiteSpeed Cache for automatic cache warming
Configure SSL with Let's Encrypt
# Via WebAdmin Console:
# Listeners → HTTPS → Edit → SSL tab
# Use OLS's built-in ACME client:
# Via command line
/usr/local/lsws/admin/misc/acmesh.sh -t example.com
# Or install certbot and configure manually
apt install -y certbot
certbot certonly --webroot -w /var/www/example.com/html -d example.com -d www.example.com
# Configure SSL in OLS listener:
# Cert File: /etc/letsencrypt/live/example.com/fullchain.pem
# Key File: /etc/letsencrypt/live/example.com/privkey.pem
Verify OpenLiteSpeed is Working Correctly
# Check service status
systemctl status lsws
# Check error log
tail -50 /usr/local/lsws/logs/error.log
# Verify PHP is working
echo "" > /var/www/example.com/html/info.php
curl -s http://YOUR_VPS_IP/info.php | grep -i "litespeed"
rm /var/www/example.com/html/info.php
# Check HTTP/2 support
curl -sI --http2 https://example.com | grep -i "HTTP"
# Check header shows OpenLiteSpeed
curl -sI https://example.com | grep -i "x-powered-by\|server"
# Verify Worker processes
ps aux | grep lshttpd | head -10
systemctl restart lsws when editing config files directly, but if you edit via WebAdmin, click "Graceful Restart" on the Dashboard — graceful restart won't drop active connections.Common Issues & Troubleshooting
Error: "508 Resource Limit Reached"
PHP process hit the configured limit — increase worker limit
# WebAdmin Console: External App → lsphp83 → Edit
# Max Connections: increase from 35 to 100
# Initial Request Timeout: 60
# Or edit directly in /usr/local/lsws/conf/httpd_config.xml
# Find and increase the value
WordPress Returns 404 for Slug URLs
Rewrite rules are incorrect in Virtual Host config
# Verify rewrite rules in vhconf.conf must include:
rewrite {
enable 1
rules <<
Error: "Permission denied" when PHP writes files
OLS runs PHP as user nobody by default
# Fix ownership of web root
chown -R nobody:nogroup /var/www/example.com/html
# For WordPress uploads
chmod 755 /var/www/example.com/html/wp-content/uploads
Cannot Access WebAdmin Console after closing port 7080
You must temporarily open the port to access console
ufw allow from YOUR_IP to any port 7080
# Access console, finish work, then close
ufw delete allow from YOUR_IP to any port 7080
Frequently Asked Questions
How does OpenLiteSpeed differ from LiteSpeed Enterprise?
OpenLiteSpeed is free and open-source but lacks full HTTP/3 support, built-in WAF, and has slightly lower performance in some benchmarks. LiteSpeed Enterprise includes all features but requires a license. However, OLS is suitable for personal VPS that don't need enterprise features.
Does OpenLiteSpeed support .htaccess?
.htaccess is partially supported — RewriteEngine, Redirect, ErrorDocument, and Options mostly work. However, module-specific directives like mod_security or certain mod_headers directives are not supported. If your application uses .htaccess heavily, test before migrating.
Is migrating from Nginx/Apache to OpenLiteSpeed difficult?
It depends on your application. WordPress is very easy to migrate — just change the document root and set rewrite rules. Other PHP applications require converting Nginx config to OLS format, which has different syntax. Online converters exist but always test in staging first.