lando-wp
Use when the question is about Lando itself in a WordPress project - which commands the recipe provides (lando wp, composer, db-import, db-export, logs) versus project tooling, start vs restart vs reb
SKILL.mdskills/lando-wp/SKILL.md
GitHubLando for WordPress projects
Every project command goes through Lando. This skill says which commands always exist, which must be read from the project, and what each lifecycle command does to containers and data.
When to use
- Running WP-CLI, Acorn, Composer, Node, tests, linters, cache flushes, database import/export or log reads in a project with a
.lando.yml. - Choosing between
start,restart,rebuild,destroy,poweroffafter a change. - Editing the Landofile chain (
.lando.base.yml,.lando.dist.yml,.lando.upstream.yml,.lando.yml,.lando.local.yml). - Site not loading, red URLs, certificate warnings, port clashes, Xdebug not stopping, tooling "not found".
- Not for: production or staging hosts, CI pipelines that do not use Lando, Lando 4 /
api: 4experiments.
Inputs required
Placeholders below are filled by the session context from the triage JSON. If a placeholder is still literal, read the field yourself:
| Placeholder | Triage field | Example |
|---|---|---|
{{name}} |
runtime.lando.name |
acme |
{{webroot}} |
runtime.lando.webroot (default .) |
., web, public |
{{web_service}} |
runtime.lando.webService |
appserver or appserver_nginx |
{{core_path}} |
site.wpCli.path |
wp, public/wp |
{{php}} |
runtime.lando.php |
8.4 |
{{db_cli}} |
from runtime.lando.database |
mysql, mariadb, psql |
{{redis_service}} |
the services entry of type redis:* |
redis, cache |
{{tooling.<name>}} |
runtime.lando.tooling / runners |
{{runner.cache}} = lando cache-clear |
{{runner.node}} |
runtime.runners.node |
lando yarn, lando npm, none |
Also needed:
- Host facts:
lando version --all,docker context ls, repo path inside the WSL filesystem (not/mnt/c). - The user's consent before destructive steps:
lando destroy(loses the database),lando db-import(wipes the database first unless--no-wipe),lando poweroff(stops every Lando app),docker system prune.
Procedure
Read the Landofile chain in load order:
.lando.base.yml,.lando.dist.yml,.lando.upstream.yml, then.lando.yml, then.lando.local.yml(last wins). Ifrecipeis notwordpress, only the core commands are guaranteed (lando ssh,lando exec); there is nolando wp. Details: references/landofile.md.Separate built-ins from project tooling. The
wordpressrecipe always provideslando wp,lando composer,lando php,lando db-import,lando db-exportand the database CLI (lando mysql,lando mariadbfor MariaDB 10.4+,lando psql). It does not provideyarn,npm,node,redis-cli,pull,pushor a dedicatedacorncommand: if they exist, the project defined them undertooling:. Read every tooling name; never assume one. Details: references/wordpress-recipe.md.Check state.
lando list --app {{name}}; if nothing runs,lando start(first run builds images, downloads WP-CLI and Composer, runs build steps andpre-startevents; it can take minutes and needs network). Thenlando info --format jsonfor URLs, services and database credentials.Run commands from the project root, so
wp-cli.ymlapplies:- WP-CLI:
lando wp <cmd>; add--path=/app/{{core_path}}only when there is nowp-cli.yml. - Acorn:
{{runner.acorn}}when the project defines it, elselando wp acorn <cmd>. - PHP packages:
lando composer <cmd>. Node:{{runner.node}} <cmd>, on the service the tooling names. - Tests, linters, cache:
{{runner.test}},{{runner.lint}},{{runner.cache}}; without a cache tool,lando wp cache flushandlando wp acorn optimize:clear. - Anything without a route:
lando ssh -s appserver -c "<cmd>"(deprecated, removed in Lando 4) orlando exec appserver -- <cmd>. Packages installed as root this way vanish on the next rebuild; persist them withbuild_as_root. - If
excludes:listsvendorornode_modules, the host copy is not the container copy: never run hostcomposerornpmfor that project.
The Composer and Node project that owns Acorn is not always the repo root. Pass the container path (
/app/...):sage-themeacorn-mu-pluginradicle-appAcorn's composer.jsontheme folder: lando composer --working-dir=/app/<theme path>; the root one (Bedrock) holds WordPress and pluginsplugin folder: lando composer --working-dir=/app/<plugin path>; rootlando composeronly installs WordPress and pluginsproject root: lando composerpackage.json/ Vitetheme folder (tooling dir:orcdin the toolingcmd)plugin folder (tooling dir:orcdin the toolingcmd)project root, often on a separate Node service lando wp acornanswersonly while the theme is active always always - WP-CLI:
Apply configuration changes with the right lifecycle command (references/cli-semantics.md):
Change Command .lando.yml,.lando.local.yml,env_filecontents, build steps, PHP version or extensions,xdebug,webroot,vialando rebuild -y(database kept;-s <service>for a subset)Wedged processes, no config change lando restart(does not re-run build steps)Database credentials, type or major version; empty database wanted lando destroy -y && lando start(data lost; export first)Tooling command "not found" after editing tooling:lando --clear, thenlandoGlobal ~/.lando/config.ymllando poweroff, thenlando startTeam settings go in
.lando.yml; personal ones in.lando.local.yml(gitignored).env_fileis a top-level key: nested underconfig:it is silently ignored.Database work. Import with
lando db-import <file>(the file must be inside the project directory;.sql,.sql.gz,.zip; wipes first unless--no-wipe; firespre-db-import/post-db-import). Export withlando db-export [file]or--stdout. GUI clients:lando info --service database --format jsongivesexternal_connection(127.0.0.1:<port>, port changes on restart unless pinned withservices.database.portforward: <port>); credentialswordpress/wordpress/wordpress, or passwordlessroot. Inside the app, the host isdatabase, neverlocalhost.Diagnose.
lando logs -s appserver -s {{web_service}} -f(stdout/stderr only);lando ssh -c "tail -f /app/{{webroot}}/wp-content/debug.log"whenWP_DEBUG_LOGis on;lando info --deep;~/.lando/logs/{{name}}-error.log; rerun with-vvvv. Symptom table: references/failure-modes.md. WSL2 specifics (CA trust, filesystem, Docker integration): references/wsl2.md.Finish.
lando stopfrees this app;lando powerofffrees ports 80/443 for everything (ask first: it stops other projects too).
Verification
lando info --service {{web_service}} --format jsonlistshttps://{{name}}.lndo.site;curl -kI https://{{name}}.lndo.siteanswers 200 or a redirect.lando wp core is-installed && lando wp option get siteurlmatches the.lndo.siteURL;lando wp acorn --versionanswers on Acorn projects.lando php -vshows{{php}};lando composer --version;{{runner.node}} --versionwhen Node tooling exists.lando {{db_cli}} -e 'select 1'succeeds.- After a rebuild:
lando php -m | grep -i <ext>for added extensions;lando ssh -c "env | grep LANDO_WEBROOT"prints/app/{{webroot}}. lando redis-cli pingreturnsPONG, only when that tooling exists and itsserviceis{{redis_service}}.landowith no arguments lists every project tooling name; if one is missing,lando --clear.
Failure modes
| Symptom | Cause | Fix |
|---|---|---|
URLs red in lando start, browser cannot resolve *.lndo.site |
No internet, or router DNS-rebinding protection (the wildcard resolves to 127.0.0.1 through public DNS) | nslookup {{name}}.lndo.site; add 127.0.0.1 {{name}}.lndo.site to hosts; use the localhost:<port> URL from lando info |
| Certificate not trusted in the Windows browser | The Lando CA lives in the WSL distro, not in the Windows store | certutil -addstore -f "ROOT" \\wsl.localhost\<distro>\home\<user>\.lando\certs\LandoCA.crt from Windows; see references/wsl2.md |
lando <tool>: unknown command after editing tooling: |
Tooling routes are cached | lando --clear, then lando |
| Tooling fails with "No such service" | Tooling service: names a service that does not exist |
Fix the tooling entry, or run lando ssh -s <real-service> -c <cmd> |
| Env var missing inside the container | env_file nested under config:, or an injected file edited without rebuild |
Move env_file to the top level and lando rebuild -y |
wp or composer not found, build step fails each start |
Download from GitHub blocked (proxy, corporate network); failing build steps re-run every start | Proxy variables in an env file, or install a pinned binary in build_as_root; lando rebuild -y |
| "This does not seem to be a WordPress installation" | Ran from a subfolder without wp-cli.yml in scope |
Run from the root, or lando wp --path=/app/{{core_path}} ... |
| Port 5173/5174 "already allocated" | Another app publishes the same host port | Stop that app or change services.<svc>.ports |
| Everything slow | Repo on /mnt/c or slow Docker file sharing |
Move the repo into the WSL home; excludes: [vendor, node_modules] + rebuild |
The full 20-row table lives in references/failure-modes.md.
Escalation
- Lando itself misbehaves: rerun with
--debug -vvvv, collect~/.lando/logs/lando-error.log,~/.lando/logs/{{name}}-error.log,lando version --all,docker version, then open an issue onlando/landoor the plugin repository (lando/wordpress,lando/php). - Landofile defects found by triage (misplaced
env_file, tooling pointing at a missing service, unpinned database version, keys the recipe ignores): report them to the project maintainers; do not edit.lando.ymlon your own initiative. - Hosting, CI or production parity questions are outside this skill.
- Lando 4 /
api: 4: out of scope; Lando 3.26.x is the supported line and the next major is unreleased.