[solved] How to setup xdebug and phpstorm

You don’t need 9000:9000 in docker, as it’s the container that will try to access your host - phpstorm acts as the server. Here your firewall might of course drop in, as some external process (the docker container) tries to contact your machine on port 9000.
You only need the following to get XDebug running:

RUN echo “zend_extension = xdebug.so” >> /etc/php5/fpm/conf.d/40-custom.ini
RUN echo “xdebug.remote_enable = 1” >> /etc/php5/fpm/conf.d/40-custom.ini
RUN echo “xdebug.remote_connect_back = 1” >> /etc/php5/fpm/conf.d/40-custom.ini

an of course you need to start XDebug by adding the XDebug Session Cookie manually, or with the Xdebug Helper Chrome extension.

Cheers,
Björn