Dev Containers
A Development Container (dev container) is a Docker container that is configured to be used as fully functional development environment.
IntelliJ IDEA lets you use such container to edit, build, and run your projects. If you need to see a specification for a development container, refer to Dev Container properties.
IntelliJ IDEA also supports multiple container connections that can be configured with Docker Compose properties.
tip
You can use the sample project to quickly check the process of creating a dev container.
You can start a dev container inside the IDE. You can also start it locally or remotely from either JetBrains Gateway or IntelliJ IDEA.
warning
Before starting to work with Dev Containers, make sure you have read Prerequisites and limitations.
You can open a project that has the .devcontainer
folder with the devcontainer.json
file in the root inside IntelliJ IDEA and start a dev container from the IDE by using Docker.
Open your project with the
devcontainer.json
file inside the IDE.You can open the project locally or remotely.
Open the
devcontainer.json
file in the editor.In the left gutter, click and select Create Dev Container and Mount Sources.
The following options are also available in the context menu:
Create Dev Container and Clone Sources: use this option to clone your project into a dev container.
Show Dev Containers: use this option to check a list of existing dev containers. You can see which ones are active and running, stop them, or restart them.
Manage Dev Container Backends: use this option to manage the dev container backends such as select and remove the unnecessary ones from a dev container.
After a dev container is created, click Continue.
The container is created and the project is opened in JetBrains Client.
You can start a dev container from JetBrains Gateway either locally or connect to a remote server using SSH.
Launch JetBrains Gateway.
From the available options on the right, click Create Dev Container.
If you want to build the dev container on a remote machine, click next to the docker field to open the Docker dialog.
Specify the necessary configuration and click OK.
note
Keep in mind that the Docker connection supports only the key-pair ssh authorization. If you connect to a remote server using a password, generate the key-pair locally and then forward it to a remote server.
In the Git Repository field, specify the path to your project on GitHub.
The project to which you are referring should have a
devcontainer.json
file that contains the dev container configuration.If you want to build the dev container locally, click Build Container and Continue.
After the dev container is built, click Continue to open the project with JetBrains Client.
At this point, you can work with your project further.
You can start a dev container right from IntelliJ IDEA either locally or remotely via SSH.
Launch IntelliJ IDEA.
From the welcome screen, click Remote Development and then Dev Containers.
Click New Dev Container.
In the Git Repository field, specify the path to your project on GitHub.
The project to which you are referring should have a
devcontainer.json
file that contains the dev container configuration.If you want to build the dev container locally, click Build Container and Continue.
If you want to build the dev container on the remote machine, open the Connect via SSH section, specify the necessary configuration and then click Build Container and Continue.
After the dev container is built, click Continue to open the project with JetBrains Client.
At this point, you can work with your project further.
When you close your project, you can choose how to handle the dev container. You can close the project and keep the dev container active, or you can close the project and also stop running the dev container.
All the recent dev containers are displayed on the welcome screen under the Dev Containers node for local projects or under the remote server name. You can start and stop recent dev containers right from the welcome screen of JetBrains Gateway or IntelliJ IDEA.
Thanks for your feedback!