Local WordPress with Docker Compose

A practical walkthrough for running WordPress locally with Docker Compose, without fighting volume mounts.

Why containers help

Pinned images keep PHP, Apache and MariaDB consistent across machines. The child theme and wp-content stay on the host so edits refresh immediately.

Tip: Prefer copying local-only mu-plugins into place instead of nesting file bind mounts under wp-content on Docker Desktop.

Compose sketch

services:
  wordpress:
    image: wordpress:php8.3-apache
    volumes:
      - ./wp-content:/var/www/html/wp-content

Once MariaDB is healthy, install WordPress with WP-CLI and activate your child theme.

3 responses

  1. Alex Nguyen Avatar
    Alex Nguyen

    Clear walkthrough — the note about avoiding nested bind mounts under wp-content saved me an afternoon.

    1. Glad it helped. Docker Desktop + virtiofs is picky about nested file mounts.

  2. Mai Tran Avatar
    Mai Tran

    Would love a follow-up on WP-CLI aliases for day-to-day local work.

Leave a Reply

Your email address will not be published. Required fields are marked *

About

Editor · LowNKey

Practical notes on technology, WordPress, and shipping careful infrastructure.

Topics index