Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Decoupled Drupal using Lando in Containers: Configuration for Debugging

Configuration for Debugging Decoupled Drupal using Lando.


This snippet is for a decoupled system divided in some folders, something like:


And so, you need debug your Drupal backend folder using xdebug from Lando and VSCode as IDE.


Can require restart the Lando system and rebuild the containers when you change versions or ports. Use:

$ lando stop && lando poweroff && lando start

In the last versions > 3.0 is using port 9003.

# Placed in /root-project/.lando.yml
composer_version: "1.10.21"
xdebug: debug
php: .lando/php.ini
# Placed in /root-project/backend/.vscode/launch.json
# Remember: that pathMapping ⇒ "/app/backend/web" is defined in your lando main file:
# cmd: drupal --root=/app/backend/web
# It can be different in your installation / configuration.
# Don't forget delete the comment, JSON doesn't allow it.
"version": "0.2.0",
"configurations": [
"name": "XDebug - Lando",
"type": "php",
"request": "launch",
"port": 9003,
"log": true,
"pathMappings": {
"/app/backend/web": "${workspaceRoot}/web",
; Placed in /root-project/.lando/
; Local settings
xdebug.mode = debug
xdebug.client_host = ${LANDO_HOST_IP}
xdebug.client_port = 9003
xdebug.start_with_request = yes
xdebug.log = /tmp/xdebug.log
; Remote settings
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_host = ${LANDO_HOST_IP}
xdebug.idekey = VSCODE
xdebug.remote_log = /tmp/xdebug.log
xdebug.remote_port = 9003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment