This repository provides a DDEV add-on that configures a WordPress development environment with Kanopi’s standard tooling and workflows. It includes:
This add-on converts the existing Docksal-based Kanopi WordPress workflow to DDEV, providing the same functionality and commands in a DDEV environment.
ddev add-on get kanopi/ddev-kanopi-wp
To add this addon to an existing WordPress project that doesn’t have DDEV:
# macOS with Homebrew
brew install ddev/ddev/ddev
# Other platforms: https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/
cd /path/to/your/wordpress/project
ddev config --project-name=your-project-name --project-type=wordpress --docroot=web --create-docroot
wp-config.php
before the wp-settings.php
line: // Include for ddev-managed settings in wp-config-ddev.php.
$ddev_settings = dirname(__FILE__) . '/wp-config-ddev.php';
if (is_readable($ddev_settings) && !defined('DB_USER')) {
require_once($ddev_settings);
}
ddev add-on get kanopi/ddev-kanopi-wp
ddev start
ddev config global --web-environment-add=TERMINUS_MACHINE_TOKEN=your_token_here
ddev restart
ddev refresh
After installation, configure and initialize your development environment:
# 1. Configure your project settings (interactive wizard)
ddev configure
# 2. Initialize your complete development environment
ddev init
ddev configure
- Interactive setup wizard that prompts you for:
ddev init
- Complete development environment setup that automatically:
For Pantheon users, you’ll need to set your machine token globally (shared across all DDEV projects):
# Set your Pantheon machine token globally
ddev config global --web-environment-add=TERMINUS_MACHINE_TOKEN=your_token_here
# Restart DDEV to apply the token
ddev restart
Get your token: Visit Pantheon’s Machine Token page to create a token.
If you skip the interactive setup or want to edit your configuration later:
# Edit .ddev/config.kanopi.yaml
wordpress:
admin_user: "your-admin-username"
admin_pass: "your-admin-password"
admin_email: "[email protected]"
pantheon: # Only if using Pantheon
site: "your-pantheon-site-name"
env: "dev" # or test, live
# Note: Machine token is set globally, not in config files
licenses: # Optional premium plugins
acf_client_user: "your-acf-license-key"
gf_client_user: "your-gravity-forms-license-key"
A local configuration file is automatically created during installation with common settings commented out. This file is automatically added to .gitignore
to keep personal settings private.
To customize local settings:
.ddev/config.kanopi.local.yaml
ddev restart
to apply changesCommon local overrides:
# .ddev/config.kanopi.local.yaml
# Enable XDebug for local debugging
development:
xdebug_enabled: true
# Override image proxy settings
proxy:
base_url: "https://test-your-site.pantheonsite.io"
# Override WordPress admin for local development
wordpress:
admin_user: "localadmin"
admin_pass: "localpass123"
# Override Pantheon environment for testing
pantheon:
env: "test" # or "live"
Command | Description |
---|---|
ddev configure |
Interactive setup wizard (configure project settings) |
ddev init |
Initialize complete development environment (runs all setup commands) |
ddev create-block <block-name> |
Create a new WordPress block with proper scaffolding |
ddev development |
Start the development server with file watching |
ddev production |
Build production assets |
ddev refresh |
Pull database from Pantheon and perform local setup |
ddev activate-theme |
Activate the custom theme |
ddev restore-admin-user |
Restore the admin user credentials |
ddev phpcs |
Run PHP Code Sniffer |
ddev phpcbf |
Run PHP Code Beautifier and Fixer |
ddev npm <command> |
Run npm commands (automatically runs in theme directory if available) |
ddev terminus <command> |
Run Terminus commands for Pantheon integration |
ddev open |
Open the site in your default browser |
ddev open cms |
Open WordPress admin in your default browser |
ddev describe
)The add-on automatically configures:
ddev create-block my-custom-block
ddev development
web/wp-content/themes/custom/struts/assets/src/blocks/my-custom-block/
with: block.json
- Block metadataindex.js
- Block registrationedit.js
- Editor interfacesave.js
- Frontend output (or render.php
for server-side rendering)style.scss
- Frontend styleseditor.scss
- Editor stylesview.js
- Frontend JavaScriptThe add-on includes tools for working with Pantheon:
.ddev/config.kanopi.yaml
ddev refresh
For premium plugins (ACF Pro, Gravity Forms), provide your license keys during the interactive setup or add them to .ddev/config.kanopi.yaml
under the licenses
section. The add-on will automatically configure Composer authentication for these plugins.
@wordpress/scripts
and Webpackassets/build/
folder is not committed and is built during development/deploymentContributions are welcome! Please ensure:
tests/test.bats
fileFor issues and questions:
Originally Contributed by Kanopi Studios