What you are building
Dify is an open-source platform for building AI applications, workflows, agents and retrieval-augmented generation services. This guide follows the official Docker Compose path and adds the checks needed before a public launch.
Before you begin
Deployment plan
The official repository contains the Compose configuration under the docker directory. Copy the example environment file, review secrets and exposed ports, start the stack, then finish setup through the installation page.
Production checks
Sources and next steps
Review the official Dify repository for current commands and release notes. Compare a suitable AI application server plan before deployment.
你将部署什么
Dify 是用于构建 AI 应用、工作流、智能体和检索增强生成服务的开源平台。本教程遵循官方 Docker Compose 安装路径,并补充公网发布前必须完成的检查。
开始前准备
部署思路
官方仓库的 docker 目录包含 Compose 配置。复制示例环境文件,检查密钥和暴露端口,启动服务后,再通过安装页面完成初始化。
生产环境检查
资料来源与下一步
请在执行前查看 Dify 官方仓库 的最新命令和版本说明,并在部署前比较合适的 AI 应用服务器方案。
Deployment steps部署步骤
Install Docker and verify Compose安装 Docker 并验证 Compose
Install Docker from the official Docker documentation for your distribution. Confirm both the engine and Compose plugin are available.
按照 Docker 官方文档为当前发行版安装 Docker,并确认 Docker 引擎和 Compose 插件都可使用。
docker --version
docker compose versionClone the official Dify repository克隆 Dify 官方仓库
Clone the repository and enter the Docker deployment directory. Review the release or tag you intend to operate before going live.
克隆官方仓库并进入 Docker 部署目录。正式上线前,应确认准备长期运行的版本或标签。
git clone https://github.com/langgenius/dify.git
cd dify/dockerCreate and review the environment file创建并检查环境配置
Copy the provided example. Replace default secrets, confirm URLs and keep the resulting file out of public repositories.
复制官方示例文件,替换默认密钥并确认访问地址。生成的环境文件不得进入公开仓库。
cp .env.example .env
chmod 600 .envStart the application stack启动应用服务
Start the services in detached mode, then review container status and recent logs before opening the setup page.
以后台方式启动服务,并在打开初始化页面前检查容器状态和近期日志。
docker compose up -d
docker compose ps
docker compose logs --tail=100Complete setup and add HTTPS完成初始化并配置 HTTPS
Open the documented installation route, create the first administrator, then place the service behind Caddy. Restrict direct access to internal service ports.
访问官方说明中的安装路径,创建首个管理员,然后通过 Caddy 反向代理服务,并限制外部直接访问内部端口。
# Example Caddy target
# dify.example.com {
# reverse_proxy 127.0.0.1:80
# }