VSCode into Remote Docker Host Container XDebug

Written by James McDonald

September 30, 2021

I have another post that is VSCode on Windows 10 SSH into remote host and working in the project source directory then Xdebug

This post is different as it connecting to the Remote Docker Container and working inside the container.

VSCode running on Windows 10

Remote Docker host is running Ubuntu 20.04 and a number of containers running on docker

Windows 10 has Docker Desktop installed

launch.json contains

In VSCode Remote Explorer under Containers has a list of containers running on my remote Ubuntu box (see settings.json)

settings.json tells vscode about your remote Docker Host

Inside the container I have xdebug 3 compiled and the conf files with contents of both these the same



/etc/php/7.4/cli/conf.d/25-xdebug.ini inside container

xdebug.mode = debug
xdebug.remote_enable = 1
; xdebug.remote_connect_back = 1
; xdebug.remote_host =
; this 
; xdebug.client_host=
xdebug.idekey = "VSCODE"
xdebug.client_port = 9000
xdebug.remote_autostart = 1
xdebug.start_with_request = yes


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…