Skip to main content

Overview

This template provides a production‑ready WordPress instance as a Monk runnable. You can:
  • Run it directly to get a managed WordPress site with database
  • Inherit it in your own runnable to seamlessly add a CMS to your stack
WordPress powers over 40% of all websites on the internet. It’s a powerful, flexible CMS for blogs, e-commerce sites, and enterprise portals.

What this template manages

  • WordPress container (wordpress image, configurable tag)
  • MySQL or MariaDB database
  • Network service on ports 80/443
  • Persistent volumes for uploads, themes, and plugins
  • Optional initialization of database and security keys

Quick start (run directly)

  1. Load templates
  1. Run WordPress stack
  1. Customize credentials (recommended via inheritance)
Running directly uses the defaults defined in this template’s variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
  • Preferred: inherit and replace variables with secret("...") as shown below.
  • Alternative: fork/clone and edit the variables in wordpress/stack.yaml, then monk load MANIFEST and run.
Once started, access WordPress at http://localhost:80 and complete the famous 5-minute installation.

Configuration

Key variables you can customize in this template:
Data is persisted under ${monk-volume-path}/wordpress and ${monk-volume-path}/mysql on the host. Inherit the WordPress runnable in your application and declare a connection. Example:
Then set the secrets once and run your site:

Ports and connectivity

  • HTTP: TCP port 80
  • HTTPS: TCP port 443 (if configured with SSL)
  • Admin panel: http://\<host>/wp-admin/
  • From other runnables in the same process group, use connection-hostname("\<connection-name>") to resolve the WordPress host.

Persistence and configuration

  • WordPress files: ${monk-volume-path}/wordpress/html:/var/www/html
  • Uploads: ${monk-volume-path}/wordpress/uploads:/var/www/html/wp-content/uploads
  • Plugins: ${monk-volume-path}/wordpress/plugins:/var/www/html/wp-content/plugins
  • Themes: ${monk-volume-path}/wordpress/themes:/var/www/html/wp-content/themes
  • MySQL data: ${monk-volume-path}/mysql:/var/lib/mysql
  • Combine with databases (MariaDB, MySQL) for content storage
  • Use with CDN for static asset delivery
  • Integrate with object storage (S3, Minio) for media files

Troubleshooting

  • Access WordPress admin at http://localhost/wp-admin/
  • For database connection errors, verify MySQL is running and credentials are correct
  • If you changed wordpress-db-password but the container has existing data, authentication may fail. Either reset the data volume or update the password inside the DB to match.
  • Enable WordPress debug mode in wp-config.php:
  • Check logs:
  • For white screen of death, check PHP error logs
  • For plugin conflicts, rename plugins folder to disable all
  • For theme issues, switch to default theme