Dify服务器部署教程

发布于:2025-02-11 ⋅ 阅读:(146) ⋅ 点赞:(0)

Dify的github地址:
https://github.com/langgenius/dify

服务器要求:2c4g

1、克隆仓库

可以通过命令或者下载zip解压后上传服务器都行
git clone https://github.com/langgenius/dify.git

2、docker启动

 cd dify/docker
 cp .env.example .env
 docker compose up -d

启动完成后可以看到下面截图

3、docker启动可能遇到的异常

①、网络原因会出现的异常:

需要更换国内的镜像地址,检查服务器防火墙

Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

以下是国内镜像,我这边多了一个腾讯云的,要不腾讯云服务超时

{
    "registry-mirrors": [
        "https://mirror.ccs.tencentyun.com",
        "https://docker.m.daocloud.io/",
        "https://huecker.io/",
        "https://dockerhub.timeweb.cloud",
        "https://noohub.ru/",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn",
        "https://xx4bwyg2.mirror.aliyuncs.com",
        "http://f1361db2.m.daocloud.io",
        "https://registry.docker-cn.com",
        "http://hub-mirror.c.163.com",
        "https://mirror.tuna.tsinghua.edu.cn/docker/",
        "https://reg-mirror.com"
    ]
}
②、守护线程没有启动

启动守护线程就行

sudo systemctl daemon-reload

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
③、daemon.json文件配置错误

通过下面的命令可以查看异常信息

sudo dockerd --debug

如果报下面的错误就是配置有问题,检查daemon.json文件就行

unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character 'r' looking for beginning of object key string
###  4、登录dify

在浏览器输入地址:http://服务器ip 就可以直接访问了
![](https://i-blog.csdnimg.cn/img_convert/7b00268d64ae7962ad139ff23eb33b95.png)

网站公告

今日签到

点亮在社区的每一天
去签到