Setup php interpreter from docker via ssh

I have local network with 2 computers: windows laptop with phpstorm and ubuntu dev server. On server I got docker-compose with php-fpm image.

Can you please tell me how to configure the interpreter for this setup?


I add docker deamon connection via ssh and get success.


First try:

Add remote interpreter from docker:

Got volume error:

What is this value and how i can fix it? They are not in the docker-compose.yml


Second try:

Add remote interpreter from docker compose:

Got parse error

I sopose, that phpstorm run docker compose from windows laptop, not via ssh.

If drop docker executable path from Docker->Tools

Got this error: 

So, there should be path from ssh host

But I can specify only local path here...

Thanks in advance for help


Unfortunately, remote Docker interpreters are not supported:


Ok, I got the solution.

General idea: make phpstorm think that the remote ssh host got php-fpm server on it, while real php-fpm server run inside docker container.

I've got next setup: - work station with windows and phpstorm - local dev server with ubuntu and docker

docker: php-fpm (container name: sandbox4-php)


1. Create executable file /usr/bin/php-sandbox to redirect all php calls to docker container

#! /bin/bash

docker exec sandbox4-php /usr/local/bin/php "$@"

2. Сhange all file paths in the docker container to match the paths on the dev server (docker-compose.yml, Dockerfile, nginx.conf)

My path to project root: /var/projects/sandbox4

3. Throw volume from /home/$user/.phpstorm_helpers to same path on container

Without this step phpsorm can't parse response from interpreter

4. Setup ssh iterpreter

PHP executable should be gateway to docker: /usr/bin/php-sandbox

5. Configure debugger - this step I still fail. 

I setup phpstorm to see php.ini file with this settings, but phpstorm still call debugger  with default setting:

I solve thi problem another way

6. Config debug server with mappings

7. To run php with xdebug all the time, I add environment variables to docker-compose.yml


PHP_IDE_CONFIG: serverName=dev

8. Add run configuration, nothing special

9. PROFIT! :)


Limitations: ofcourse, this config will work only in local network. To run this for remote server need VPN, but i'm fine with that.

If anyone has solution to normal configure debug run in phpstorm - pls, share. I'm put up with every run - is debug run, so far.


PS. OMG, phpstorm is realy painfull for setup...