DockerWP is a pre-configured Docker-based WordPress environment designed for vulnerability research, testing, and debugging. It is used by the Wordfence Bug Bounty Program and provides researchers with a portable, flexible, and repeatable local lab setup.
This repository contains two lab environments for testing against different PHP versions:
dockerwp74/– WordPress on PHP 7.4dockerwp84/– WordPress on PHP 8.4
NOTE: Exploitation of certain vulnerabilities, like PHAR deserialization, will only work on PHP 7.4
- Docker Desktop (Windows / macOS / Linux)
- Git (to clone this repo)
-
Clone this repository:
git clone https://github.com/wordfence/bbp-dockerwp cd bbp-dockerwp -
Choose a lab environment:
- For PHP 7.4:
cd dockerwp74- For PHP 8.4:
cd dockerwp84 -
Build the environment:
docker-compose build- Start the environment:
docker-compose up -d-
Access WordPress
- Visit http://localhost:1337 to complete the WordPress installation.
If you're running on an Apple Silicon Mac (M1/M2), Docker may fail to start containers due to architecture differences. You might see:
no matching manifest for linux/arm64/v8 in the manifest list entriesTo resolve this:
- Edit your
docker-compose.yml - Add this line to each service mentioned in the file:
platform: linux/amd64- If you're using MySQL, consider switching to:
image: mariadb:latestMailcatcher is included to help test email functionality like password resets or new user notifications.
- Mailcatcher UI: http://localhost:1080
- SMTP Host:
mailcatcher - SMTP Port:
1025
Use Simple SMTP for easy setup:
- Install Simple SMTP from the WordPress plugin repository.
- In plugin settings:
- SMTP Host:
mailcatcher - SMTP Port:
1025 - Use SMTP Authentication:
No
- SMTP Host:
- Save settings and trigger a test email.
Emails will appear in the Mailcatcher UI at http://localhost:1080
Adminer is a single-file MySQL database manager included in both configurations by default.
- Access it at: http://localhost:1337/adminer.php
- Login credentials match those defined in your docker-compose.yml
Both environments come with XDebug pre-installed and configured.
- Install the PHP Debug extension by Xdebug.
- Open the “Run and Debug” panel in VSCode.
- Click “create a launch.json” and select PHP.
- VSCode will generate a working config — no need to manually edit it unless customizing path mappings.
The wpcli container lets you use the full WP-CLI command line tool.
docker-compose exec wpcli wp plugin list
docker-compose exec wpcli wp user create test test@example.com --role=subscriber --user_pass=passwordTo use WP-CLI as a one-liner from your terminal, add this to your shell profile:
- bash/zsh (
~/.bashrcor~/.zshrc):
alias wp='docker-compose run --rm wpcli'- Windows (Command Prompt):
doskey wp=docker-compose.exe run --rm wpcliNow you can run commands like:
wp plugin install wordfence --activateJoin the Wordfence Researcher Discord: 👉 https://discord.com/invite/awPVjTNTrn
Read the full setup and usage guide in the blog post:
👉 WordPress Security Research Series: Setting Up Your Research Lab