# Docker Compose

[Docker Compose](https://docs.docker.com/compose/overview/) is used to run multi-container applications. For example, you can run a web server, a backend database, and your application code as separate services. Each service can be scaled by adding more containers if necessary. This enables you to perform efficient development and testing in a dynamic environment, similar to production.

Procedure: Enable the Docker plugin

This functionality relies on the [Docker](https://plugins.jetbrains.com/plugin/7724-docker)  plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

> **Note:**
> The Docker plugin is available by default only in IntelliJ IDEA  with the Ultimate subscription. For IntelliJ IDEA, you need to install the Docker plugin as described in [Plugins](managing-plugins.html).

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the Docker plugin, and select the checkbox next to the plugin name.

IntelliJ IDEA recognizes [Docker Compose files](https://docs.docker.com/compose/compose-file/) and marks them with the ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/clouds-docker-impl.icons.expui.dockerCompose.svg) icon. It also adds [gutter icons](editor-gutter.html#gutter-action-icons) to run various services defined in the Docker Compose file.

![Docker Compose file](https://resources.jetbrains.com.cn/help/img/idea/2026.2/docker_compose_file.png)

Procedure: Create a Docker Compose file

1. In the   Project tool window  (`Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+1` (NetBeans), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS))) , right-click the project root, select New or press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Ctrl+N` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (NetBeans), `Ctrl+N` (Visual Studio), `⌘ N` (Visual Studio (macOS)), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)), and then select Docker Compose File.

![Create a docker-compose.yml](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_docker_compose_containerize_docker_compose_menu.png)

2. In the popup that opens, accept the default Docker Compose file name or specify a custom one and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

![Create a docker-compose.yml](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_docker_compose_containerize_docker_compose.png)

Procedure: Complete a service configuration

1. Open a Docker Compose file in the editor.

2. Start typing the service name. IntelliJ IDEA will display the Services popup, where you can select the corresponding configuration.

![Docker Compose completion. Choose a service](https://resources.jetbrains.com.cn/help/img/idea/2026.2/docker-compose-select-service.png)

> **Tip:**
> You can use the basic completion shortcut (`Ctrl+Space` (Windows), `⌃ Space` (macOS), `⌃ Space` (IntelliJ IDEA Classic (macOS)), `⌃ Space` (macOS System Shortcuts), `Ctrl+Space` (XWin), `Ctrl+Space` (GNOME), `Ctrl+Space` (KDE), `Alt+/` (Emacs), `Ctrl+Space` (Sublime Text), `⌃ Space` (Sublime Text (macOS)), `Ctrl+Space` (NetBeans), `Ctrl+Space` (Visual Studio), `⌃ Space` (Visual Studio (macOS)), `Ctrl+Space` (Eclipse), `⌃ Space` (Eclipse (macOS))) to invoke the Services popup.
>
>
>
> To disable this behavior, go to `Settings | Build, Execution, Deployment | Docker | Docker Compose` and deselect the Show popup on basic completion invocation option.

Procedure: Run a multi-container Docker application

1. Define necessary services in one or several [Docker Compose files](https://docs.docker.com/compose/compose-file/).

2. In the main menu, go to `Run | Edit Configurations`.

3. Click ![The Add icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg), point to Docker and then click Docker Compose.

![Docker Compose run configuration dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/docker-compose-run-config.png)

4. Specify the Docker Compose files with your service definitions. If necessary, you can define the services that this configuration will start, specify [environment variables](https://docs.docker.com/compose/environment-variables/), and force building of images before starting corresponding containers (that is, add the `--build` option for the [docker compose up](https://docs.docker.com/compose/reference/up/) command).

For more information about the available options, refer to [Docker compose run configuration](docker-compose-run-configuration.html).

5. Click OK to save the Docker Compose run configuration, select it in the main toolbar, and click ![the Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.run.svg) or press `Shift+F10` (Windows), `⌃ R` (macOS), `⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ R` (macOS System Shortcuts), `Shift+F10` (XWin), `Shift+F10` (GNOME), `Shift+F10` (KDE), `Shift+F10` (Emacs), `Shift+F10` (Sublime Text), `Shift+F10` (Sublime Text (macOS)), `F6` (NetBeans), `Ctrl+F5` (Visual Studio), `⌃ F5` (Visual Studio (macOS)), `Alt+Shift+X` (Eclipse), `⌘ ⇧ F11` (Eclipse (macOS)) to start the configuration.

> **Tip:**
> To quickly create a Docker Compose run configuration and run it with default settings, right-click a Docker Compose file in the Project tool window and click Run in the context menu. You can also use gutter icons and the context menu in the Docker Compose file to run and manage services.

When Docker Compose runs your multi-container application, you can use the  [Services](services-tool-window.html#docker)  tool window (`Alt+8` (Windows), `⌘ 8` (macOS), `⌘ 8` (IntelliJ IDEA Classic (macOS)), `⌘ 8` (macOS System Shortcuts), `Alt+8` (XWin), `Alt+8` (GNOME), `Alt+8` (KDE), `Alt+8` (Emacs), `Alt+8` (Sublime Text), `⌘ 8` (Sublime Text (macOS)), `Alt+8` (NetBeans), `Alt+8` (Visual Studio), `Alt+8` (Visual Studio (macOS)), `Alt+8` (Eclipse), `⌘ 8` (Eclipse (macOS))) to control specific services and [interact with containers](docker-containers.html#interacting-with-containers). The containers that run as part of Docker Compose are listed under the dedicated Compose nodes, not under the Containers node (which is only for standalone containers).

When you open a Docker Compose file in the editor, IntelliJ IDEA displays [inlay hints](inlay-hints.html) with statuses of services and available port actions.

* Service status A status inlay hint is displayed next to each service name and indicates whether the service is running or failed. Clicking the inlay hint you navigates you to container logs in the Services tool window. ![Service status in a Docker Compose file in the editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/docker-compose-state-inlay.png)

* Port actions (Open URL) For services that expose ports, IntelliJ IDEA provides quick actions directly in the editor: * Open in browser: opens the service URL in the default browser. * Connect to database: opens the corresponding database connection workflow, allowing you to inspect the database and run queries directly from the IDE. For more details, refer to [Data sources](managing-data-sources.html). > **Note:** > Port actions are currently available only for local Docker environments.

Procedure: Scale a service

1. In the  Services  tool window, select the service you want to scale and click ![The Scale button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.expandAll.svg) or select  Scale  from the context menu.

2. In the Scale dialog, specify how many containers you want for this service and click OK.

Procedure: Stop a running service

* In the  Services  tool window, select the service and click ![The Stop button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.stop.svg) or select  Stop  from the context menu.

Procedure: Stop all running services

* In the  Services  tool window, select the Compose node and click ![The Stop button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.stop.svg) or select  Stop  from the context menu.

Procedure: Bring your application down

* In the  Services  tool window, select the Compose node and click ![The Down button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.nodes.undeploy.svg) or select  Down  from the context menu.

This stops and removes containers along with all related networks, volumes, and images.

Procedure: Open the Docker Compose file that was used to run the application

* In the  Services  tool window, right-click the Compose node or a nested service node and then click  Jump to Source  in the context menu or press `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (NetBeans), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F12` (Eclipse), `F3` (Eclipse (macOS)).

## See also

### Tutorials

[Run and debug a Spring Boot application using Docker Compose](run-and-debug-a-spring-boot-application-using-docker-compose.html)

### Reference

[Services tool window](services-tool-window.html)

