> ## 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.

# Dify Helm Chart

## 要求

* 发布日志: [https://langgenius.github.io/dify-helm](https://langgenius.github.io/dify-helm)
* Kubernetes 1.24+
* Helm 3.14+
* `警告`: 如果你使用的是受限环境（如 OpenShift），请确保允许 pods 以 `root` 身份运行。

## 快速开始

### 获取 Helm 仓库信息

```bash theme={null}
helm repo add dify https://langgenius.github.io/dify-helm
helm repo update
```

查看 [helm repo](https://helm.sh/docs/helm/helm_repo/) 的命令文档。

### 检查可用版本

* 如果你想检查社区版和企业版之间的版本，可以使用以下命令。
* `APP VERSION` 是 Dify 社区版的版本，`CHART VERSION` 是 Dify 企业版的版本。

```bash theme={null}
helm repo update
helm search repo dify/dify --versions
```

查看 [helm search repo](https://helm.sh/docs/helm/helm_search_repo/) 的命令文档。

### 安装或升级

首次安装或升级 Dify，你可以使用以下命令：

<Warning>
  在升级之前，请确保备份你的数据库。如果升级失败，你可以快速回滚版本并恢复数据库。
</Warning>

```bash theme={null}
helm repo update
helm search repo dify/dify
helm upgrade -i dify -f values.yaml dify/dify
# 如果你想升级到目标版本，可以使用以下命令：
# helm upgrade -i dify -f values.yaml dify/dify --version x.x.x
```

查看 [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) 的命令文档。

## 高级配置

### 卸载

要卸载 Dify，你可以使用以下命令：

<Warning>
  * 如果你想重新安装 Dify，请确保先清理 `dify_plugin_daemon` 的数据库。
  * 有关更多详细信息，请参阅 [Postgresql 数据库](/zh/3.7.x/deploy/advanced-configuration/postgresql-database)。
</Warning>

```bash theme={null}
helm uninstall dify
```

查看 [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) 的命令文档。

### 显示 Helm Chart 值

```bash theme={null}
helm show values dify/dify
```

查看 [helm show values](https://helm.sh/docs/helm/helm_show_values/) 的命令文档。

### 使用 Helm Template 生成 Kubernetes YAML

```bash theme={null}
helm template dify -f values.yaml dify/dify > dify-k8s-template.yaml
```

查看 [helm template](https://helm.sh/docs/helm/helm_template/) 的命令文档。

### 下载 Helm Chart 到本地

```bash theme={null}
helm pull dify/dify
# helm pull dify/dify --version x.x.x
```
