Columbia Games · WordPress / 14 May 2026

WP-CLI belongs where WordPress actually runs

Running WP-CLI on the host would have introduced another PHP and tooling mismatch. I placed it in the same container runtime that the application itself used.

2 min read
Columbia Games · WordPress
WP-CLIDockertoolingWordPress

Situation

Without WP-CLI, serious WordPress maintenance quickly turns into repetitive admin clicking. But running the tool on the host means using the host's PHP version, extensions and network context, which recreates exactly the machine-specific layer Docker was supposed to remove.

Approach

I made WP-CLI part of the custom WordPress image. It therefore ran with the same PHP version, extensions and container network as the application. Documented commands used `docker compose exec`, so developers did not need to install and maintain a separate WP-CLI version on their laptops.

Outcome

Core, plugin, cache and database operations became scriptable and repeatable. A new development machine no longer required checking a locally installed CLI version, and later upgrades used the same pinned environment for both WordPress and its maintenance tooling.