- Dev containers: the whole project opens inside the container described by its
devcontainer.json, with the IDE backend running there. This is remote development, like SSH. - Docker and Docker Compose run targets: the project stays local and only a run configuration runs in a container.
Dev containers
Requirements
- Docker installed on your machine, with the daemon of the current Docker context running locally. The project folder is bind-mounted into the container, so a daemon on another machine doesn’t work.
- The Dev Containers CLI (
devcontainer). Install Dev Containers CLI from Settings › Languages & Frameworks › Language Servers (it needs Node.js), or putdevcontaineron yourPATH. - A
.devcontainer/devcontainer.jsonor.devcontainer.jsonin the project folder. - The project must be trusted: building the container runs the project’s commands (
initializeCommand, the Dockerfile build). - A Linux container on x86_64 or aarch64.
Reopen a project in its container
1
Open the project locally
Open the folder that contains the
devcontainer.json and trust it.2
Reopen in the container
Choose File › Reopen in Container, then This Window or New Window if asked.
3
Wait for the container
OpenIDEA runs
devcontainer up for the folder, which builds or starts the container. The first build can take a
while. Then it installs and starts openidea-server in the container and opens the
project folder there.remoteWorkspaceFolder, as its remoteUser. The status bar shows
Dev Container: <folder name>, and the project appears in the recent projects list on the Welcome screen.
If something fails (no devcontainer.json, Docker not installed, the build failed), a notification
Could not reopen the project in a container shows the reason, including the end of the CLI’s log.
What applies from devcontainer.json
- Everything
devcontainer uphandles: image, Dockerfile, features, mounts and the lifecycle commands. They run once, through the CLI; the server doesn’t runpostStartCommandagain. remoteEnv: applied to terminals, runs, language servers and tools in the container. Change it and choose File › Reload Environment to apply it to new processes.forwardPorts: forwarded to your machine automatically. Forward more in the Ports tool window, as in an SSH window.
~/.openidea/data.
Limits
- Only the default configuration is used (
.devcontainer/devcontainer.json, then.devcontainer.json). There is no picker for several configurations in subfolders of.devcontainer/. - Reopen in Container is available for local projects only, not from an SSH or WSL window.
- There is no command to attach to an arbitrary running container; the container always comes from the project’s
devcontainer.json.
Docker and Docker Compose run targets
A run target runs a run configuration somewhere other than your machine. Container targets rewrite the configuration into a localdocker run --rm (or docker compose run --rm) with the project bind-mounted, so the console, input,
Stop and test results work as for a local run.
1
Add a target
Open Settings › Build, Execution, Deployment › Run Targets, click +, and set Type to Docker or
Docker Compose.
2
Describe the container
For Docker, enter the Image (for example
python:3.12). For Docker Compose, list the Compose files
(empty uses the project’s default file) and the Service.3
Use it
Pick the target under Run on in a run configuration, or make it the Default run target.
See Run configurations for run targets in general, including SSH targets.