docker-cms: PHP 8.5 Docker Image for WordPress and CMS Hosting

docker-cms: PHP 8.5 Docker Image for WordPress and CMS Maintenance

docker-cms is a specialized Docker container image for maintenance and troubleshooting of PHP-based CMS environments. It’s not designed to run your production WordPress, Drupal, or Joomla site directly. Instead, it provides a controlled environment for working on your CMS platform.

What is docker-cms?

The idea is simple: mount your existing WordPress (or other PHP CMS) installation into a docker-cms container, and you get instant access to:

  • PHP 8.5 CLI and CGI environments
  • Composer and dependency management
  • WP-CLI for WordPress administration
  • Database tools (MySQL, PostgreSQL clients)
  • Development and debugging tools (Xdebug, etc.)
  • Theme and plugin development environment

Use Cases

docker-cms is perfect for:

WordPress Theme and Plugin Development

Mount your local WordPress theme or plugin directory into the container and develop with full IDE integration, debugging tools, and instant feedback.

WP-CLI Batch Operations

Run bulk database operations, user management, content migration, and other administrative tasks from the command line without affecting your running production site.

Database Backups and Migration

Export WordPress databases, create backups, and prepare migrations using the included database tools.

Debugging Production Issues

Mount a copy of your production WordPress and debug issues in isolation using Xdebug, logging, and other diagnostic tools.

Getting Started

1. Pull the Image

docker pull docker-cms:latest

2. Mount Your WordPress

docker run -it --rm -v /path/to/wordpress:/wordpress docker-cms:latest bash

This mounts your WordPress installation at /wordpress inside the container.

3. Run WP-CLI Commands

wp --path=/wordpress user list
wp --path=/wordpress plugin install plugin-name --activate
wp --path=/wordpress db export /wordpress/backup.sql

Features

docker-cms includes:

  • PHP 8.5 – Latest stable PHP version with modern language features
  • WP-CLI – Complete WordPress command-line interface
  • Composer – PHP dependency manager for themes and plugins
  • MySQL and PostgreSQL clients – Connect to any database backend
  • Git – Version control for theme and plugin development
  • Xdebug – PHP debugger for IDE integration
  • Node.js and npm – JavaScript tooling for front-end development

Configuration

The docker-cms image works out-of-the-box for most use cases. For advanced scenarios, you can override environment variables:

docker run -e WORDPRESS_DB_HOST=db.example.com            -e WORDPRESS_DB_NAME=wp_production            -v /path/to/wordpress:/wordpress            docker-cms:latest bash

Important Notes

  • Not for production – docker-cms is a development and maintenance tool, not a production runtime
  • Ephemeral by default – Use --rm to auto-clean containers after use
  • Mount read-write – Changes made in the container affect your host filesystem
  • Database connectivity – Ensure the container can reach your WordPress database (network configuration)

Support and Documentation

For detailed usage, configuration options, and examples, refer to the myguard Docker documentation.