gow

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT

README

gow

WordPress on OpenLiteSpeed, simplified.

CI Release Go Report Card

A single-command CLI tool for managing WordPress (and plain PHP/HTML) sites on OpenLiteSpeed web server. Handles the entire server stack lifecycle — from installation to site creation, SSL, backups, and monitoring.


Features

  • Full Stack Installation — OpenLiteSpeed, LSPHP, MariaDB, Redis, WP-CLI, Composer, Certbot
  • Site Lifecycle Management — Create, update, delete, clone, backup, and restore WordPress sites
  • Automatic SSL/TLS — Let's Encrypt integration with HTTP-01 and DNS-01 (wildcard) support
  • Smart Resource Allocation — Auto-sizes PHP worker pools based on server RAM and CPU
  • Per-Site Isolation — Dedicated system users for multi-tenant security
  • Built-in Caching — LSCache page cache + Redis object cache wired automatically
  • Live Metrics — Disk, database, Redis, and OLS request monitoring
  • Backup Scheduling — Automated daily/weekly backups with retention policies
  • WP-CLI Passthrough — Run wp commands scoped to any site

Requirements

Minimum Recommended
OS Ubuntu 22.04 / Debian 12 Ubuntu 24.04 / Debian 12
Architecture amd64 (x86_64) amd64
RAM 1 GB 2 GB+
Disk 10 GB 20 GB+
Access root root

gow must run as root. It manages system packages, writes to /usr/local/lsws, /var/www, /etc, and creates system users.

Stack installed by gow stack install:

Component Purpose
OpenLiteSpeed Web server
LSPHP 8.1–8.5 PHP processor
MariaDB Database
Redis Object cache
WP-CLI WordPress management
Composer PHP dependency management
Certbot SSL certificates (Let's Encrypt)

Install

wget -qO gow https://raw.githubusercontent.com/aprakasa/gow/main/install.sh && sudo bash gow

Or download directly from releases:

curl -SL https://github.com/aprakasa/gow/releases/latest/download/gow -o /usr/local/bin/gow
chmod +x /usr/local/bin/gow

Uninstall:

sudo install.sh --purge

Usage

Provision the server and create a WordPress site:

sudo gow stack install
sudo gow site create example.com --type wp --tune blog --php 83

Need SSL?

sudo gow site ssl example.com --email admin@example.com

Running a WooCommerce store?

sudo gow site create shop.example.com --type wp --tune woocommerce

WordPress multisite?

sudo gow site create network.example.com --type wp --multisite subdirectory

Want daily backups?

sudo gow site backup-schedule example.com              # daily, keep 7
sudo gow site backup-schedule example.com --schedule weekly --retain 14

Clone a site for staging?

sudo gow site clone example.com staging.example.com

Check server health?

gow status
gow metrics

Full command reference: docs/gow.md

Tuning Presets

Preset PHP Memory Workers Use Case
lite 128 MB 64 MB Small static sites
standard 256 MB 128 MB Typical blog
business 384 MB 192 MB High-traffic site
woocommerce 512 MB 256 MB WooCommerce store
heavy 768 MB 384 MB Large multisite
custom user-defined user-defined Full control

Workers are auto-sized from server RAM and CPU. Override defaults with /etc/gow/policy.yaml.

Development

make build       # build binary
make test        # run tests (race detector on)
make vet         # go vet
make lint        # golangci-lint
make coverage    # test coverage report
make cross-build # linux/amd64 cross-compile

CI runs on every push and PR: build, vet, test, golangci-lint, govulncheck, and smoke tests.

Releases are cut by pushing a v* tag — GoReleaser builds the binary and publishes a GitHub release.

License

MIT

Directories

Path Synopsis
cmd
gow command
Package main is the gow CLI entrypoint.
Package main is the gow CLI entrypoint.
internal
allocator
Package allocator computes per-site LSPHP cluster sizing for OpenLiteSpeed.
Package allocator computes per-site LSPHP cluster sizing for OpenLiteSpeed.
app
Package app contains the business logic for the gow CLI, separated from the cobra command wiring in cmd/gow.
Package app contains the business logic for the gow CLI, separated from the cobra command wiring in cmd/gow.
metrics
Package metrics collects live server metrics from OLS, Redis, MariaDB, and disk.
Package metrics collects live server metrics from OLS, Redis, MariaDB, and disk.
ols
Package ols manages OpenLiteSpeed configuration and lifecycle.
Package ols manages OpenLiteSpeed configuration and lifecycle.
site
Package site orchestrates the WordPress-on-OLS lifecycle: create, delete, and reconcile.
Package site orchestrates the WordPress-on-OLS lifecycle: create, delete, and reconcile.
stack
Package stack defines installable LiteSpeed/LSPHP/MariaDB components and their lifecycle hooks (install, upgrade, start, status, …) used by the CLI.
Package stack defines installable LiteSpeed/LSPHP/MariaDB components and their lifecycle hooks (install, upgrade, start, status, …) used by the CLI.
state
Package state persists the site registry to a JSON file so that allocations survive across gow invocations.
Package state persists the site registry to a JSON file so that allocations survive across gow invocations.
system
Package system provides hardware detection for the resource allocator.
Package system provides hardware detection for the resource allocator.
template
Package template renders OpenLiteSpeed configuration files from Go templates embedded at compile time.
Package template renders OpenLiteSpeed configuration files from Go templates embedded at compile time.
testmock
Package testmock provides test helper utilities shared across internal packages.
Package testmock provides test helper utilities shared across internal packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL