Docker
Last modified: 17 March 2023Docker is a tool for deploying and running executables in isolated and reproducible environments. This may be useful, for example, to test code in an environment identical to production.
PhpStorm integrates the Docker functionality and provides assistance for creating Docker images, running Docker containers, managing Docker Compose applications, using public and private Docker registries, and much more directly from the IDE.
note
The PhpStorm Docker images naming scheme has changed. Now, instead of individual version-specific images such as
phpstorm/php-71-apache-xdebug-26
, use feature-specific names such asphpstorm/php-cli
orphpstorm/php-apache
, and provide a version via:tag
. For example, thephpstorm/php-71-apache-xdebug-28
image is now accessible asphpstorm/php-apache:7.1-xdebug2.8
.
Enable the Docker plugin
This functionality relies on the Docker plugin, which is bundled and enabled in PhpStorm by default. If the relevant features aren't available, make sure that you didn't disable the plugin.
Press Ctrl+Alt+S to open the IDE settings and select Plugins.
Open the Installed tab, find the Docker plugin, and select the checkbox next to the plugin name.
Install and run Docker
For information about installing and running Docker, see the Docker documentation.
tip
PhpStorm supports alternative Docker daemons: Colima and Rancher Desktop (with the
dockerd
engine).
Connect to the Docker daemon
Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Docker.
Click
to add a Docker configuration and specify how to connect to the Docker daemon.
The connection settings depend on your Docker version and operating system. For more information, see Docker connection settings.
The Connection successful message should appear at the bottom of the dialog.
tip
The default docker-machine value is fine if:
The actual name of the executable file is docker-machine.
The path to the directory with the executable file is in the
PATH
environment variable.
To specify an actual path to the executable file, click
and select the file in the dialog that opens.
note
The Path mappings table is used to map local folders to corresponding directories in the Docker virtual machine's file system. Only specified folders will be available for volume binding.
This table is not available on Linux, because when running Docker on Linux, any folder is available for volume binding.
Open the Services tool window (View | Tool Windows | Services or Alt+8), select the configured Docker connection node
and click
, or select Connect from the context menu.
To edit the Docker connection settings, select the Docker node and click
on the toolbar, or select Edit Configuration from the context menu.
You can also click
and select Docker Connection to add a Docker connection directly from the Services tool window. If you have Docker contexts configured, you can select Docker Connections from Docker Contexts to add the corresponding connections.
Once you connect to the Docker daemon, you can use the Services tool window (View | Tool Windows | Services or Alt+8) to manage everything related to Docker, for example: pull and push images, create and run containers, and scale Docker Compose services. As with other tool windows, you can start typing the name of an image or container to highlight the matching items.

For more information, see the section about Docker in Services tool window.
Thanks for your feedback!