$docker.recipes

OpenLiteSpeed

intermediate

High-performance, lightweight open-source HTTP server.

[i]Overview

OpenLiteSpeed is a high-performance, open-source HTTP server developed by LiteSpeed Technologies as the community edition of their commercial LiteSpeed Web Server. Built with an event-driven architecture, OpenLiteSpeed excels at handling thousands of concurrent connections with minimal resource usage, making it particularly effective for dynamic content delivery and PHP applications. Unlike traditional web servers that use process-based or thread-based models, OpenLiteSpeed employs an asynchronous, non-blocking I/O model that significantly reduces memory overhead while maximizing throughput. This Docker deployment creates a complete web server environment with OpenLiteSpeed's built-in PHP processing capabilities and administrative interface. The configuration includes persistent storage for web content and server data, ensuring your websites and configurations survive container restarts. OpenLiteSpeed's native support for Apache .htaccess rules means existing websites can be migrated without rewriting rewrite rules or access controls. This setup is ideal for developers and system administrators who need a lightweight yet powerful alternative to Apache or Nginx, particularly when hosting PHP applications like WordPress, Drupal, or custom web applications. The included web-based administration panel simplifies server management tasks that typically require command-line expertise, making OpenLiteSpeed accessible to users who prefer graphical interfaces for server configuration and monitoring.

[*]Key Features

  • [+]Event-driven architecture with asynchronous I/O handling up to 200,000+ concurrent connections
  • [+]Native LSCache engine with built-in object caching and ESI support for dynamic content acceleration
  • [+]Web-based administration console accessible on port 7080 for real-time server management
  • [+]Built-in PHP LSAPI for optimal PHP performance without requiring separate PHP-FPM processes
  • [+]Apache .htaccess compatibility allowing drop-in replacement without configuration changes
  • [+]Real-time statistics and monitoring with bandwidth throttling and connection limits
  • [+]Integrated ModSecurity WAF support for web application security protection
  • [+]HTTP/3 and QUIC protocol support for improved performance over unreliable networks

[#]Common Use Cases

  • [1]High-traffic WordPress hosting requiring LSCache plugin integration for maximum performance
  • [2]Development environments for PHP applications needing Apache-compatible rewrite rules
  • [3]Small to medium business websites requiring reliable performance with minimal server resources
  • [4]Content delivery optimization for e-commerce sites with heavy dynamic content loads
  • [5]Migration from Apache servers while maintaining existing .htaccess configurations
  • [6]Educational environments teaching web server administration through graphical interfaces
  • [7]Staging servers for testing website performance under different server configurations

[!]Prerequisites

  • [!]Docker Engine 20.10+ and Docker Compose V2 for container orchestration support
  • [!]Minimum 512MB RAM available for OpenLiteSpeed processes and caching operations
  • [!]Ports 80, 443, and 7080 available on the host system for HTTP, HTTPS, and admin access
  • [!]Basic understanding of web server concepts and virtual host configuration
  • [!]Knowledge of PHP application deployment if hosting dynamic websites
  • [!]SSL certificate files ready if enabling HTTPS for production websites
[!]

WARNING: For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

[$]docker-compose.yml

[docker-compose.yml]
1services:
2 openlitespeed:
3 image: litespeedtech/openlitespeed:latest
4 container_name: openlitespeed
5 restart: unless-stopped
6 environment:
7 TZ: UTC
8 volumes:
9 - ./html:/var/www/vhosts/localhost/html
10 - ols_data:/usr/local/lsws
11 ports:
12 - "80:80"
13 - "443:443"
14 - "7080:7080"
15 networks:
16 - ols-network
17
18volumes:
19 ols_data:
20
21networks:
22 ols-network:
23 driver: bridge

[$].env Template

[.env]
1TZ=UTC

[i]Usage Notes

  1. [1]Docs: https://openlitespeed.org/kb/
  2. [2]Admin panel at https://localhost:7080 (default: admin/123456)
  3. [3]CHANGE DEFAULT PASSWORD immediately after first login
  4. [4]LSCache plugin for WordPress - significant performance boost
  5. [5]Event-driven architecture - handles many connections efficiently
  6. [6]Compatible with Apache .htaccess rewrite rules

[>]Quick Start

[terminal]
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 openlitespeed:
5 image: litespeedtech/openlitespeed:latest
6 container_name: openlitespeed
7 restart: unless-stopped
8 environment:
9 TZ: UTC
10 volumes:
11 - ./html:/var/www/vhosts/localhost/html
12 - ols_data:/usr/local/lsws
13 ports:
14 - "80:80"
15 - "443:443"
16 - "7080:7080"
17 networks:
18 - ols-network
19
20volumes:
21 ols_data:
22
23networks:
24 ols-network:
25 driver: bridge
26EOF
27
28# 2. Create the .env file
29cat > .env << 'EOF'
30TZ=UTC
31EOF
32
33# 3. Start the services
34docker compose up -d
35
36# 4. View logs
37docker compose logs -f

[>]One-Liner

Run this command to download and set up the recipe in one step:

[terminal]
1curl -fsSL https://docker.recipes/api/recipes/openlitespeed/run | bash

[?]Troubleshooting

  • [!]Admin panel shows 'Connection refused' on port 7080: Ensure firewall allows traffic on port 7080 and container is fully started before accessing
  • [!]PHP scripts download instead of executing: Configure virtual host document root correctly and verify PHP is enabled for the specific virtual host
  • [!]High memory usage during traffic spikes: Adjust max connections and memory limits in server configuration through admin panel tuning section
  • [!]LSCache not working with WordPress: Install LSCache WordPress plugin and configure cache root directory to match OpenLiteSpeed cache settings
  • [!].htaccess rules not working: Enable rewrite engine in virtual host settings and verify AllowOverride is set to appropriate level
  • [!]SSL certificate errors: Upload certificate files through admin panel SSL tab and restart gracefully to apply new certificates

Community Notes

Loading...
Loading notes...

## Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

## Components

openlitespeed

## Tags

#openlitespeed#litespeed#performance#php#wordpress

## Category

Web Servers & Reverse Proxies