Spin up a fresh WordPress site (latest or pinned) with:
- DDEV (per-project containers, HTTPS, fast file I/O)
- One-shot init script (
ddev init) - Adminer add-on (DB UI)
- PHPCS/WPCS (coding standards)
- PHPStan + WordPress extension + stubs (static analysis)
Project name & URL: If you don’t set a
name:in.ddev/config.yaml, DDEV uses the folder name as the project name.
URL becomeshttps://<folder-name>.ddev.site.
- Docker Desktop (or equivalent)
- DDEV installed (
ddev versionshould work) gitinstalled
# 1) Clone your repo
git clone <YOUR_GIT_URL> my-great-site
cd my-great-site
# 2) (Optional) Override defaults
cp .env.example .env
# Edit .env to pin a WP version or set admin/email, else defaults are used:
# - Title: <folder-name>
# - Admin user: <folder-name>-admin
# - Admin pass: admin
# - Admin email: <folder-name>@example.com
# 3) Start containers
ddev start
# 4) Initialize the project (Composer tools + WordPress install + Adminer)
ddev initWhen ddev init finishes, it prints your primary URL, e.g.:
https://my-great-site.ddev.site
Log into WP Admin with:
- User:
<folder-name>-admin(or whatever you set in.env) - Pass:
admin(change it after login)
Open Adminer:
ddev adminerLogin:
- System: MySQL
- Server: db
- Username: db
- Password: db
- Database: db
ddev start # start this project
ddev stop # stop this project (containers down, volumes intact)
ddev poweroff # stop ALL ddev projects globally
ddev list # list all projects + their URLs/status
ddev describe # show current project's URL + routed services
ddev ssh # shell into the web container
ddev launch # open the site in your browserddev init # runs .ddev/commands/web/init (Composer + WP + Adminer)ddev adminer # open Adminer URL for this projectddev wp <cmd> # WP-CLI (e.g., ddev wp plugin list)
ddev composer install # install dev tools (PHPCS, PHPStan, etc.)
ddev composer update # update dev toolsIf you added the Composer script aliases:
ddev composer lint # PHPCS (uses phpcs.xml.dist if present)
ddev composer fix # PHPCBF (auto-fix style issues)
ddev composer stan # PHPStan analysis (uses phpstan.neon.dist)If you added the Makefile targets:
make lint
make fix
make standdev snapshot # save DB snapshot
ddev snapshot --list # list snapshots
ddev snapshot restore <name> # restore a snapshot.ddev/
config.yaml # DDEV project config (no 'name:' → uses folder name)
commands/web/init # custom init command (Composer + WP + Adminer)
scripts/wp-install.sh # installs WP (latest or pinned), creates config, installs site
.env.example # copy to .env to override title/user/email/version
.gitignore # keep repo clean (vendor, uploads, cache)
composer.json # dev tools: PHPCS/WPCS, PHPStan, WP extension
phpcs.xml.dist # PHPCS defaults: WordPress ruleset, paths, excludes
phpstan.neon.dist # PHPStan defaults: level, WordPress extension + stubs
Defaults if .env is not set:
- Site Title:
<folder-name> - Admin User:
<folder-name>-admin - Admin Email:
<folder-name>@example.com - Admin Pass:
admin - WP Version: latest
Set WP_VERSION in .env before ddev init, e.g.:
WP_VERSION=6.6.2
Leave it blank for latest.
PHPCS (WordPress Coding Standards):
ddev composer lint
# or
ddev exec vendor/bin/phpcsPHPCBF (auto-fix what can be fixed):
ddev composer fix
# or
ddev exec vendor/bin/phpcbfPHPStan (with WordPress awareness):
ddev composer stan
# or
ddev exec vendor/bin/phpstan analyseConfiguration files (phpcs.xml.dist and phpstan.neon.dist) define:
- paths to scan (
public/wp-content/themes/my-theme, etc.), - excludes (
vendor,node_modules,dist), - WP rules/extension/stubs,
- initial PHPStan strictness (
level: 5).
Raise PHPStan’s level gradually as you clean up findings.
- Installed automatically by
ddev init(first run) via the DDEV add-on. - To remove later:
ddev add-on remove ddev/ddev-adminer ddev restart
-
URL didn’t print?
Runddev describeto see the primary URL and routed services. -
Re-run init safely
ddev initis idempotent: it’ll skip steps that are already done. -
WP didn’t install?
Ensure containers are started (ddev start), then runddev initagain. -
Change admin creds after install
Use WP Admin or WP-CLI:ddev wp user update <user> --user_pass=<newpass>
Stops and removes containers/volumes for this project (keeps code):
ddev delete -OyRecreate:
ddev start
ddev init