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
What this template manages
- WordPress container (
wordpressimage, 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)
- Load templates
- Run WordPress stack
- Customize credentials (recommended via inheritance)
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
variablesinwordpress/stack.yaml, thenmonk load MANIFESTand run.
http://localhost:80 and complete the famous 5-minute installation.
Configuration
Key variables you can customize in this template:${monk-volume-path}/wordpress and ${monk-volume-path}/mysql on the host.
Use by inheritance (recommended for websites)
Inherit the WordPress runnable in your application and declare a connection. Example: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
Related templates
- 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-passwordbut 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