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

# 激活许可证

<Warning>
  * 许可证绑定到 Kubernetes 集群的 `命名空间`。
  * 激活后不要更改 `命名空间`。
</Warning>

## 激活方式

* 在线激活(默认)
* 离线激活

## 在线激活

* 点击 Dify 企业版后台左侧目录的 License 栏，轻点右上角的激活按钮。
* 激活类型选择 `Online`，输入 `License ID` 完成激活。
* 激活许可证后，你需要重启 `enterprise` 服务以使新许可证生效。

```bash theme={null}
kubectl rollout restart deployment dify-enterprise
```

![](https://assets-docs.dify.ai/2025/04/767730970c14696c6eea2eb3b2289898.png)

## 离线激活

* 点击 Dify 企业版后台左侧目录的 License 栏，轻点右上角的激活按钮，激活类型选择 `Offline`。
* 复制 `Cluster ID` 并发送至你的 Dify 商务团队以获取 `Offline Code`。

![](https://assets-docs.dify.ai/2024/11/3b5198ceff1db9bab8e614b7ef39e699.png)

* 在激活许可证之前，需要将 `values.yaml` 文件中的 `licenseMode` 值改为 `offline`。

  1. 显示 Helm Chart 配置

     ```
     helm show values dify/dify
     ```

  2. 将许可证模式设置为 `offline`

     ```yaml theme={null}
     enterprise:
         licenseMode: "offline"
     ```

  3. 应用配置变更（重新部署使其生效）

     ```bash theme={null}
     helm upgrade -i dify -f values.yaml dify/dify
     ```

* 修改完成后，回到 License 激活窗口，输入 `Offline Code` 完成激活。

* 激活许可证后，你需要重启 `enterprise` 服务以使新许可证生效。

```bash theme={null}
kubectl rollout restart deployment dify-enterprise
```

![](https://assets-docs.dify.ai/2024/11/beac33066670e291dbafa1c71c2bf58c.png)

## 更新许可证

* 更新许可证的流程与激活流程相同。
* 更新许可证后，你需要重启 `enterprise` 服务以使新许可证生效。

```bash theme={null}
kubectl rollout restart deployment dify-enterprise
```
