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

1. **在网络配置中设置域名白名单**，允许访问必要的域名，或
2. **遵循以下流程**实现完全网络隔离部署

## 域名白名单

如果选择设置域名白名单，请确保以下域名可访问：

* [https://marketplace.dify.ai](https://marketplace.dify.ai)
* [https://pypi.org](https://pypi.org)

## 禁用Marketplace访问

通过禁用marketplace连接，避免因外部请求失败导致的问题：

```yaml theme={null}
  marketplace:
    enabled: false # 禁用marketplace访问
    url: "https://marketplace.dify.ai"
    apiUrl: "https://marketplace.dify.ai"
```

## 配置自定义镜像仓库

如果你的网络无法访问 `docker.io`，可以使用自定义的镜像仓库替代默认镜像地址。

```yaml theme={null}
plugin_connector:
  gatewayImage: "nginx:1.27.3"
  shaderImage: "gcr.io/kaniko-project/executor:latest"
  busyBoxImage: "busybox:latest"
  awsCliImage: "amazon/aws-cli:latest"
  generatorConf: |
    generator:
      repo: langgenius
      python:
        pipMirror: ""
        preCompile: true
        versions:
          python3.13:
            langgenius: docker.io/langgenius/plugin-build-base-python:3.13
          python3.12:
            langgenius: docker.io/langgenius/plugin-build-base-python:3.12
          python3.11:
            langgenius: docker.io/langgenius/plugin-build-base-python:3.11
          python3.10:
            langgenius: docker.io/langgenius/plugin-build-base-python:3.10
```

1. 需要替换为私有镜像的镜像列表：

* `gatewayImage`：插件网关服务镜像。
* `shaderImage`：构建插件时使用的 shader 镜像。
* `busyBoxImage`：插件运行时使用的 busybox 镜像。
* `awsCliImage`：AWS CLI 工具镜像。如果未使用 AWS，可忽略此镜像。
* `python3.xx`：用于构建插件的基础镜像。

2. 将 pipMirror 替换为自定义的镜像源 URL。

3. [将镜像同步到你的私有镜像仓库](/zh/3.3.x/deploy/advanced-configuration/container-registry#syncing-images-to-a-private-registry)
