Configuration

Environment Variables

WP Launcher is configured via a .env file in the project root. The installer generates this automatically, but you can customize it.

VariableDescriptionDefault
BASE_DOMAINBase domain for site subdomainslocalhost
NODE_ENVEnvironment modedevelopment
API_KEYAPI key for machine-to-machine authAuto-generated
ADMIN_EMAILFirst admin account email—
JWT_SECRETSecret for JWT token signingAuto-generated
PUBLIC_URLPublic URL of the dashboardhttp://localhost
SMTP_HOSTSMTP server hostname—
SMTP_PORTSMTP server port587
SMTP_USERSMTP username—
SMTP_PASSSMTP password—
SMTP_SECUREUse implicit TLS (port 465 = true, port 587 = false)false
SMTP_FROMFrom address for system emails—
WP_IMAGEBase WordPress Docker image tagwp-launcher-wp
MAX_SITES_PER_USERMaximum active sites per user3
MAX_TOTAL_SITESMaximum total active sites50
CONTAINER_MEMORYMemory limit per WordPress container256m
CONTAINER_CPUCPU limit per WordPress container0.5
ENABLE_TLSEnable HTTPS via Traefikfalse
CERT_RESOLVERTraefik certificate resolver nameletsencrypt
DEFAULT_PHPDefault PHP version for new sites8.3
DEFAULT_DBDefault database engine for new sitessqlite
SHARED_DB_ROOT_PASSWORDRoot password for the shared MySQL/MariaDB servers. Required since v2.5.0 — Compose refuses to start without itAuto-generated
SITE_EXPIRY_HOURSAuto-expiry duration for demo sites72
API_PORTHost port for the API service3000

Admin Authentication

WP Launcher uses role-based authentication. There are three ways to create the first admin:

  1. Installer: The VPS installer prompts for admin email and password during setup
  2. ADMIN_EMAIL: Set ADMIN_EMAIL in .env — the first user to register with that email is auto-promoted to admin
  3. CLI: Use wpl admin:promote [email protected] to promote any existing user

The API_KEY in .env is for machine-to-machine authentication (e.g., CI/CD pipelines). It provides admin-level access to all API endpoints.

Product Config Reference

Product templates are JSON files in the products/ directory. Here's the full schema:

{
  "id": "my-product",
  "name": "My Product Demo",
  "database": "sqlite",
  "plugins": {
    "preinstall": [
      "woocommerce",
      { "source": "url", "url": "https://example.com/plugin.zip" },
      { "source": "local", "path": "my-plugin.zip" }
    ],
    "remove": ["hello", "akismet"]
  },
  "themes": {
    "install": ["flavor"],
    "active": "flavor",
    "remove": ["twentytwentyfour", "twentytwentythree"]
  },
  "demo": {
    "expiration": 72,
    "maxConcurrentPerUser": 3,
    "adminUser": { "username": "demo", "password": "demo123" },
    "landingPage": "/shop/"
  },
  "restrictions": {
    "disableFileModifications": true,
    "hiddenMenus": ["tools.php", "options-general.php"],
    "blockedCapabilities": ["install_plugins", "edit_themes"]
  },
  "branding": {
    "bannerText": "Try My Product",
    "description": "A demo of My Product plugin",
    "image": "https://example.com/banner.png"
  },
  "docker": {
    "image": "wp-launcher-wp-my-product"
  }
}

Plugin Sources

Three methods for including plugins in product templates:

SourceSyntaxDescription
WordPress.org"woocommerce"Free/public plugins by slug — downloaded during image build
URL{"source": "url", "url": "..."}Premium plugins via direct ZIP download URL
Local{"source": "local", "path": "file.zip"}Private/custom plugins from product-assets/<product-id>/

WordPress.org Plugin Icons

To display plugin icons in the dashboard, use this URL pattern:

https://ps.w.org/PLUGIN-SLUG/assets/icon-256x256.png

Replace PLUGIN-SLUG with the plugin's WordPress.org slug (e.g., woocommerce, contact-form-7).