WordPress LOMP stack (Linux + OpenLiteSpeed + MariaDB + PHP) deployed via Docker Compose. Uses LSCache plugin with built-in Redis object cache. All inter-service communication uses Unix sockets for maximum performance.
- LSCache Plugin — Full-page cache served by OpenLiteSpeed (bypasses PHP entirely)
- Redis Object Cache — Via Unix socket for minimal latency (
/var/run/redis/redis.sock) - Unix Sockets — All inter-service communication uses Unix sockets for maximum performance
- Zero Configuration — Auto-installs WordPress, WP-CLI, and LSCache on first startup
- Automatic SSL — Let's Encrypt via acme.sh sidecar, auto-provisioned on startup with automatic renewal
- Direct File Access — WordPress files in
./wordpress/on the host
flowchart TB
Client(["🌐 Client"])
subgraph Frontend
OLS["OpenLiteSpeed<br/>LSCache · SSL · :80/:443/:7080"]
end
subgraph Application
PHP["PHP 8.x<br/>WordPress · LSAPI · PhpRedis"]
end
subgraph SSL
ACME["acme.sh<br/>Let's Encrypt · Auto-renewal"]
end
subgraph Data
MariaDB["MariaDB 12<br/>Database"]
Redis["Redis 7<br/>Object Cache"]
end
Client -->|"HTTP/HTTPS"| OLS
OLS <-->|"LSAPI Unix socket"| PHP
PHP -->|"Unix socket"| MariaDB
PHP <-->|"Unix socket"| Redis
ACME -->|"Issues/renews certs"| OLS
| Component | Version | Notes |
|---|---|---|
| OpenLiteSpeed | latest | Web server with built-in LSCache |
| PHP | 8.x (bundled with OLS) | LSAPI, PhpRedis 6.3.0 |
| MariaDB | 12 | InnoDB tuned, socket-only |
| Redis | 7 (Alpine) | Unix socket, maxmemory with allkeys-lru eviction |
| WordPress | latest | Auto-installed via WP-CLI |
| WP-CLI | latest | Auto-installed in entrypoint |
| LSCache | latest | Full-page cache + Redis object cache |
| acme.sh | latest | Let's Encrypt SSL sidecar with auto-renewal |
- Clone the repository:
git clone git@github.com:aprakasa/wp-lomp-docker.git
cd wp-lomp-docker
cp .env.example .env- Edit
.envwith your domain, database credentials, and WordPress admin settings:
nano .env- Start the stack:
docker compose up -d- Access WordPress at
http://your-domain
WordPress will be automatically installed on first startup.
SSL certificates are automatically provisioned on first startup when enabled. Set these variables in .env:
SSL=1 # Enable SSL
SSL_STAGING=0 # Use 1 for testing (avoids Let's Encrypt rate limits)
DOMAIN=your-domain.com
EMAIL=admin@your-domain.comThen start the stack:
docker compose up -dThe acme.sh sidecar container will:
- Wait for OpenLiteSpeed to be healthy
- Issue a Let's Encrypt certificate via HTTP-01 webroot validation
- Install the certificate to the shared
ssl/directory - Start a daemon for automatic daily renewal checks
A self-signed certificate is used as fallback until the real certificate is issued.
Note: The old
scripts/setup-ssl.shscript is still available for manual SSL provisioning if needed.
All configuration is done via .env (copy from .env.example):
| Variable | Default | Description |
|---|---|---|
DOMAIN |
localhost |
Your domain name |
EMAIL |
admin@example.com |
Admin email (used for SSL) |
MYSQL_ROOT_PASSWORD |
- | MariaDB root password |
MYSQL_DATABASE |
wordpress |
Database name |
MYSQL_USER |
wp_user |
Database user |
MYSQL_PASSWORD |
- | Database password |
REDIS_MAXMEMORY |
64mb |
Redis max memory |
WP_ADMIN_USER |
admin |
WordPress admin username |
WP_ADMIN_PASSWORD |
- | WordPress admin password |
WP_ADMIN_EMAIL |
- | WordPress admin email |
WP_SITE_TITLE |
WordPress |
Site title |
WORDPRESS_TABLE_PREFIX |
wp_ |
Database table prefix |
OLS_WORKERS |
4 |
PHP LSAPI children (worker processes) |
SSL |
0 |
Enable Let's Encrypt SSL (1 to enable) |
SSL_STAGING |
0 |
Use Let's Encrypt staging (1 to avoid rate limits) |
TZ |
UTC |
Timezone |
Set DOMAIN in .env to your domain name. All internal paths use localhost — no config file edits needed. The OLS listener uses a catch-all (*) so it responds to any domain pointing to the server.
WordPress files are in ./wordpress/ on the host, giving you direct filesystem access. This directory is created and populated automatically on first startup.
The LSCache plugin (litespeed-cache) is automatically installed and activated on first startup. It provides:
- Full-page cache served by OpenLiteSpeed (bypasses PHP entirely)
- Redis object cache using PhpRedis via Unix socket (
/var/run/redis/redis.sock)
No additional cache plugins are needed. The Redis object cache connection is pre-configured via wp litespeed-option set during first startup.
- OLS logs:
./logs/ - MariaDB logs:
docker compose logs mariadb - Redis logs:
docker compose logs redis
Access the OpenLiteSpeed admin panel at http://your-server:7080 with default credentials:
- Username:
admin - Password: (check
docker compose exec openlitespeed cat /usr/local/lsws/adminpasswd)
# Start all services
docker compose up -d
# Stop all services
docker compose down
# View logs
docker compose logs -f openlitespeed
# Restart OLS only
docker compose restart openlitespeed
# Access WordPress CLI
docker compose exec openlitespeed wp --path=/var/www/vhosts/localhost/html --allow-root <command>- Docker Engine 20.10+
- Docker Compose V2
- 1GB RAM minimum (2GB recommended)
MIT