> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 安装气隙版 Devin Desktop

> 从门户下载气隙版 Devin Desktop 文件包，验证其 SHA-256 校验和，在 macOS、Linux 或 Windows 上完成安装，并运行健康检查。

> [!NOTE]
>
> 本文档适用于 Devin 的联邦部署。[返回 Devin 文档](/zh/get-started/devin-intro)

本页将引导你首次安装气隙版 Devin Desktop 文件包 (其中包含气隙版 Devin CLI) 。请先在一台工作站上完成安装，再通过经审批的介质传输流程，在其余设备上重复上述步骤。

## 开始之前

* 你已以**拥有活跃本地部署授权的团队的已批准成员**身份登录门户。如果没有该授权，气隙下载页面会提示你不符合资格，请联系您的账户团队。
* 你已准备好 (或即将准备) 每台主机首次启动前必需的两个文件：
  * **许可证文件**，在门户中签发 (参见 [许可证](/zh/federal/air-gapped/license)) ；
  * **模型文件**，用于描述你的模型端点 (参见 [模型文件](/zh/federal/air-gapped/models-file)) 。
* 目标主机运行的是受支持的平台：macOS (Apple silicon 或 Intel) 、Linux (x86\_64 或 aarch64) 或 Windows (x64 或 arm64) 。

## 步骤 1:从门户下载文件包

1. 在门户中,打开 **Install → Air-gapped downloads**([`windsurf.fedstart.com/install/airgap`](https://windsurf.fedstart.com/install/airgap))。

2. 选择适用于目标平台的 **Devin Desktop** 安装程序。该页面为每种平台和格式各提供一个软件包:

   | 平台 | 格式 |
   | - | - |
   | macOS,Apple 芯片 | `.dmg` |
   | macOS,Intel | `.dmg` |
   | Linux x64 | `.deb`、`.rpm`、`.tar.gz` |
   | Linux arm64 | `.deb`、`.rpm`、`.tar.gz` |
   | Windows x64 | `.exe`(系统安装程序)、`.zip` |
   | Windows arm64 | `.exe`(系统安装程序)、`.zip` |

   Windows 文件名为 `DevinSetup-<arch>-<version>.exe` 和 `Devin-win32-<arch>-<version>.zip`,其中 `<arch>` 为 `x64` 或 `arm64`。该安装程序会为所有用户安装,不提供用户级安装程序。

3. 记下页面上文件旁显示的 **SHA-256** 校验和(点击 **Show checksum** 查看),传输完成后需与其比对。

4. 按照经批准的介质传输流程,将文件传入气隙环境。

该页面还提供另外两项下载,每项均附有各自的 SHA-256 校验和:

| 下载 | 文件 | 目的 |
| - | - | - |
| **Desktop tunnel CLI** | `Devin-cli-linux-x64-<version>.tar.gz`、`Devin-cli-linux-arm64-<version>.tar.gz` | 独立的 `devin-desktop-airgap` 命令行隧道工具,用于通过 SSH 将 Desktop 连接到远程主机。请将其安装在远程机器上,而非工作站上。 |
| **Remote extension host** | `devin-reh-linux-<arch>-<version>.tar.gz`、`devin-reh-darwin-<arch>-<version>.tar.gz` | Desktop 在 SSH 目标主机上安装的服务器组件。如果主机无法自行获取该组件,请提前将其放置到主机上。 |

Devin *智能体* CLI(`devin`)不在上述下载项中,它已内置于每个 Desktop 软件包中(参见[步骤 5](#step-5-locate-the-bundled-cli))。

## 步骤 2：验证校验和

在目标主机上 (或在将文件带入物理隔离环境之前) ，计算所下载文件的 SHA-256 值，并与门户中显示的值进行比对。

**macOS**

```sh theme={null}
shasum -a 256 Devin-darwin-arm64-<version>.dmg
```

```text theme={null}
3f6c…e21a  Devin-darwin-arm64-<version>.dmg
```

**Linux**

```sh theme={null}
sha256sum Devin-linux-x64-<version>.deb
```

```text theme={null}
3f6c…e21a  Devin-linux-x64-<version>.deb
```

**Windows**

```powershell theme={null}
Get-FileHash -Algorithm SHA256 .\DevinSetup-x64-<version>.exe
```

`Hash` 值必须与门户页面上的校验和一致。由于 `Get-FileHash` 以大写形式输出该值，比对时请忽略大小写。

输出的第一列必须与门户页面上的校验和完全一致。如不一致，请删除该文件并重新下载。

## 步骤 3：安装

**macOS**

1. 打开 `.dmg`，将 **Devin - Airgap** 拖入 `/Applications`。
2. 首次启动前，验证代码签名和公证状态：

   ```sh theme={null}
   spctl --assess --type execute --verbose "/Applications/Devin - Airgap.app"
   codesign --verify --deep --strict "/Applications/Devin - Airgap.app"
   ```

   ```text theme={null}
   /Applications/Devin - Airgap.app: accepted
   source=Notarized Developer ID
   ```

   签名完好时，`spctl` 会输出 `accepted`，`codesign --verify` 则不输出任何内容并以 `0` 退出。如果输出中出现 `rejected` 或 `code object is not signed at all`，说明文件包在传输过程中已被篡改：请将其丢弃，并从步骤 1 重新开始。

**Linux (.deb / .rpm)**

```sh theme={null}
sudo dpkg -i Devin-linux-x64-<version>.deb   # Debian/Ubuntu
sudo rpm -i Devin-linux-x64-<version>.rpm    # RHEL/Fedora
```

气隙版不提供 apt 或 yum 代码仓库；请直接使用软件包文件进行安装和升级。

**Linux (.tar.gz)**

```sh theme={null}
sudo tar -xzf Devin-linux-x64-<version>.tar.gz -C /opt
```

启动程序位于 `/opt/Devin-linux-x64/bin/devin-airgap`。

**Windows（安装程序）**

1. 运行安装程序前，先验证其 Authenticode 签名：

   ```powershell theme={null}
   Get-AuthenticodeSignature .\DevinSetup-x64-<version>.exe | Format-List Status, SignerCertificate
   ```

   `Status` 必须为 `Valid`，且签名者证书必须颁发给 `Exafunction, Inc.`。如果已安装 Windows SDK，也可以使用 `signtool verify /pa .\DevinSetup-x64-<version>.exe` 执行相同的检查。如果出现其他任何状态，说明文件在传输过程中已被篡改：请将其丢弃，并从步骤 1 重新开始。
2. 以管理员身份运行 `DevinSetup-x64-<version>.exe`。安装程序会以管理员权限运行，并将 **Devin - Airgap** 为所有用户安装到 `C:\Program Files\Devin Airgap\`。

安装程序不会创建配置文件夹，也不会对其进行安全加固；请在[步骤 4](#windows-lock-down-the-configuration-folder) 中完成此操作。Windows 卸载条目名为 **Devin Airgap**。

**Windows (.zip)**

将 `Devin-win32-x64-<version>.zip` 解压到任意文件夹，并直接从该位置运行 Desktop；不会额外安装任何内容。请参照安装程序部分的说明，使用 `Get-AuthenticodeSignature` 验证解压后可执行文件的 Authenticode 签名：`Status` 必须为 `Valid`，签名者必须为 `Exafunction, Inc.`。

[步骤 4](#windows-lock-down-the-configuration-folder) 中的文件夹锁定操作同样适用于 zip 安装方式。

在 Linux 上，步骤 2 中的 SHA-256 比对即为验证步骤；这些软件包不附带单独的签名文件。

## 步骤 4：放置许可证和模型文件

独立 CLI 和 Desktop 内置的智能体读取的是相同的两个文件。将它们放在默认路径下，即无需设置任何环境变量：

| 文件 | 默认路径 | 覆盖设置 |
| - | - | - |
| 许可证 | `/etc/devin/license.devin-onprem-license` | `DEVIN_LICENSE_FILE` |
| 模型文件 | `/etc/devin/models.json` | `DEVIN_MODELS_FILE` |

在 Windows 上，默认目录为 `C:\ProgramData\Devin\`，覆盖设置不变：

| 文件 | 默认路径 (Windows) | 覆盖设置 |
| - | - | - |
| 许可证 | `C:\ProgramData\Devin\license.devin-onprem-license` | `DEVIN_LICENSE_FILE` |
| 模型文件 | `C:\ProgramData\Devin\models.json` | `DEVIN_MODELS_FILE` |

### Windows：锁定配置文件夹

在 Windows 上，无论使用安装程序还是 zip 包，都必须执行此步骤，安装程序不会替你完成。默认情况下，标准用户可以在 `C:\ProgramData` 下的新文件夹中创建文件，因此如果不加锁定，用户可能会抢在你之前创建 `models.json` (或许可证文件、认证文件) ，并一直掌控该文件。

**在放置任何文件之前**，请在以管理员身份运行的 PowerShell 会话中创建该文件夹并限制其权限，使 SYSTEM 和 Administrators 拥有完全控制权限，而标准用户仅有读取权限：

```powershell theme={null}
New-Item -ItemType Directory -Force C:\ProgramData\Devin
icacls C:\ProgramData\Devin /inheritance:r /grant:r "*S-1-5-18:(OI)(CI)(F)" "*S-1-5-32-544:(OI)(CI)(F)" "*S-1-5-32-545:(OI)(CI)(RX)"
```

如果 `C:\ProgramData\Devin\` 此前已存在，仅运行上述命令还不够：标准用户之前在其中创建的所有内容仍归该用户所有，而在该文件夹上显式授予其他用户或组的权限也会继续保留。运行上述命令后，还需按以下顺序运行下列命令。这些命令会将该文件夹及其内容的所有权转交给 Administrators，移除该文件夹上的所有显式权限，重新应用锁定设置，并重置其内容的权限，使其继承该文件夹的权限：

```powershell theme={null}
icacls C:\ProgramData\Devin /setowner "*S-1-5-32-544" /T /C
icacls C:\ProgramData\Devin /reset
icacls C:\ProgramData\Devin /inheritance:r /grant:r "*S-1-5-18:(OI)(CI)(F)" "*S-1-5-32-544:(OI)(CI)(F)" "*S-1-5-32-545:(OI)(CI)(RX)"
icacls C:\ProgramData\Devin\* /reset /T /C
```

确认结果。上述命令在处理任何文件或文件夹时都不应显示错误消息：`/C` 会让 `icacls` 跳过无法更改的项并继续执行，因此只要出现错误，就说明该项仍保留原来的所有者或权限。然后列出该文件夹及其中所有内容的权限：

```powershell theme={null}
icacls C:\ProgramData\Devin /T
```

文件夹 `C:\ProgramData\Devin` 本身必须恰好列出三个条目：`NT AUTHORITY\SYSTEM:(OI)(CI)(F)`、`BUILTIN\Administrators:(OI)(CI)(F)` 和 `BUILTIN\Users:(OI)(CI)(RX)`，且均不带 `(I)` 标记。该文件夹中的每个文件和子文件夹都必须列出相同的三个用户和组，不得有其他项；由于这些条目继承自该文件夹，因此每项都应带有 `(I)` 标记。例如，文件的条目应为 `NT AUTHORITY\SYSTEM:(I)(F)`、`BUILTIN\Administrators:(I)(F)` 和 `BUILTIN\Users:(I)(RX)`。如果任何位置列出了其他用户或组、文件夹上的条目带有 `(I)` 标记，或者文件或子文件夹上的条目未带 `(I)` 标记，则说明锁定未生效，请重新运行适用于已有文件夹的命令。

然后在同一个提升权限的会话中，将许可证和模型文件复制到该文件夹中。

每个模型条目都会指定一个用于存放其 API 密钥的环境变量 (`api_key.env`) ，且必须在运行智能体的进程环境中设置该变量。Desktop 的内置智能体继承的是 **Desktop 应用的**环境，而非您的 shell 环境；有关如何为 Desktop 提供该变量，请参阅[模型文件 → API 密钥环境变量](/zh/federal/air-gapped/models-file#api-key-environment-variables)。

## 步骤 5：找到内置的 CLI

Devin 智能体 CLI 内嵌在每个 Desktop 软件包中，且与 Desktop 基于同一个发布版本 commit 构建，因此两者的版本始终保持一致。

| 平台 | 软件包内路径 |
| - | - |
| macOS | `/Applications/Devin - Airgap.app/Contents/Resources/app/extensions/windsurf/devin/bin/devin` |
| Linux | `<install root>/resources/app/extensions/windsurf/devin/bin/devin` |
| Windows | `<install root>\resources\app\extensions\windsurf\devin\bin\devin.exe`，其中 `<install root>` 在通过安装程序安装时为 `C:\Program Files\Devin Airgap`，否则为你解压 zip 文件的目标文件夹 |

本指南中的 `devin …` 命令均可使用此二进制程序运行，也可以将其添加到 `PATH`。确认版本：

```sh theme={null}
"/Applications/Devin - Airgap.app/Contents/Resources/app/extensions/windsurf/devin/bin/devin" --version
```

```text theme={null}
devin-federal <version>+airgap.<sha>
```

## 步骤 6：运行健康检查

在与智能体运行时环境一致的 shell 中 (尤其要包含您的模型文件中指定的 API 密钥变量) ，运行：

```sh theme={null}
devin airgap doctor
```

```text theme={null}
pass  license                                seat alice@example.gov (account acme), expires 2027-03-01
pass  models file path                       /etc/devin/models.json
pass  config dir writable                    /home/alice/.config/devin/cli-federal
pass  data dir writable                      /home/alice/.local/share/devin/cli-federal
pass  CA bundle                              not configured (OS trust store only; set DEVIN_CA_BUNDLE to add a private CA)
pass  models file parse                      1 model(s) configured
pass  model 'llama-3.3-70b': API key env var  LOCAL_LLAMA_API_KEY is set
pass  custom subagent profiles               none configured
pass  model 'llama-3.3-70b': endpoint reachability  GET https://models.internal:8000/v1/models -> 200 OK
pass  model 'llama-3.3-70b': inference conformance  POST https://models.internal:8000/v1/chat/completions -> 200 OK (412 ms)

10 check(s): 10 passed, 0 warning(s), 0 failure(s)
```

仅当所有检查均未失败时，该命令的退出码才为 `0`。每个 `FAIL` 行都会附带错误代码，例如 `CFG002` 或 `NET003`；请在[错误代码](/zh/federal/air-gapped/error-codes)中查找对应代码，并按照[故障排查](/zh/federal/air-gapped/troubleshooting)运维手册进行处理。

## 步骤 7：首次启动

**macOS**

通过完整路径启动已安装的应用：

```sh theme={null}
open "/Applications/Devin - Airgap.app"
```

请勿使用 `open -a "Devin - Airgap"`：该命令会通过 LaunchServices 解析应用名称，可能会选中另一个副本 (例如已挂载的 `.dmg` 或旧版安装) ，而不是你已验证的那个。

**Linux**

启动软件包安装的启动程序；如果使用 tarball 安装，则运行 `/opt/Devin-linux-x64/bin/devin-airgap`。

**Windows**

启动已安装的 **Devin - Airgap** 应用；如果使用 zip 安装，则从解压后的文件夹中运行该应用程序。

如果许可证缺失或无效，Desktop 仍能打开，但内置智能体会运行失败，聊天面板中会显示 ACP 错误 `-32019 license_invalid`。此时请打开 **View → Output → Devin ACP**，查找 `LIC00X` 所在行，然后参阅[许可证](/zh/federal/air-gapped/license#error-codes)。

## 后续步骤

* 如果您的部署需要用户登录，请配置 SSO (单点登录) ：[SSO](/zh/federal/air-gapped/sso)。
* 如果您的端点使用内部证书，请添加私有 CA：[网络与证书](/zh/federal/air-gapped/network-and-certificates)。
* 了解产品将状态数据写入何处，以及如何摄取审计日志：[磁盘存储格式](/zh/federal/air-gapped/on-disk-formats)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.