# 从头开始启动开发容器。

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/help/idea/llms.txt).

> **TL;DR**
> 查看 [先决条件](prerequisites-for-dev-containers.html)和 [限制](dev-container-limitations.html)

您可以使用  `devcontainer.json`  文件及其提供的 [配置](https://containers.dev/implementors/json_reference/)选项创建新的开发容器。

最简单的入门方式是从容器注册表（包含预定义镜像的仓库集合）中为您的  `devcontainer.json`  文件拉取一个镜像（预定义模板）。

Procedure: 创建 Dev 容器

1. 在 IntelliJ IDEA 中打开一个 project。

2. 在 [项目](creating-and-managing-projects.html)视图中，右键点击项目名称并选择   新建 | Dev Container 配置  。

3. 在打开的对话框中，IntelliJ IDEA 显示了一个默认的容器配置。 如果您愿意，您可以从   开发容器模板   列表中选择其他 Dev Container 模板。

![创建新的 Dev Container](https://resources.jetbrains.com.cn/help/img/idea/2026.3/create_new_dev_container.png)

4. 点击   OK  。

IntelliJ IDEA 会生成   .devcontainer   目录，并在其中创建包含容器描述的   devcontainer.json   文件。 您可以根据需要自定义配置。

![开发容器结果](https://resources.jetbrains.com.cn/help/img/idea/2026.3/create_dev_container_result.png)

5. 在左侧边距中，点击 ![创建 Dev 容器](https://resources.jetbrains.com.cn/help/img/idea/2026.3/clouds-docker-gateway.icons.devContainers.svg) 并选择   创建 Dev Container 并挂载源代码…   以构建您的 Dev Container。

