Ubuntu20.04部署Ragflow(Docker方式)
Ubuntu20.04部署Ragflow(Docker方式)
- Ubuntu20.04 Ragflow
- Running Ragflow
- Running Ollama
由于写这篇博客的时候电脑还没装输入法,所以先用半吊子英文顶着了…关于最后运行ollama的部分可以无视,因为我修改了端口所以才需要这么运行
Ubuntu20.04 Ragflow
Running Ragflow
git clone https://github.com/infiniflow/ragflow.git
# check the value of vm.max_map_count
sysctl vm.max_map_count
# Reset vm.max_map_count to a value at least 262144 if it is not.
sudo sysctl -w vm.max_map_count=262144
cd ragflow/docker
docker compose -f docker-compose.yml up -d
problem:
WARN[0000] The "HF_ENDPOINT" variable is not set. Defaulting to a blank string.
WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string.
unable to get image 'infiniflow/ragflow:v0.17.2-slim': permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.48/images/infiniflow/ragflow:v0.17.2-slim/json": dial unix /var/run/docker.sock: connect: permission denied
solution:
modify the .env
file
RAGFLOW_IMAGE=registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:nightly-slim
but I found it should be add sudo
to the command docker compose -f docker-compose.yml up -d
and another problem:
Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint ragflow-server (a3b939ad7640ae72035b928e912fcae6dddf16255151ca80a62d22d8760a0e49): Bind for 0.0.0.0:80 failed: port is already allocated
it maybe i run dify docker…?
solution: modify ragflow-main\docker\docker-compose.yml
about ports
# from
ports:- ${SVR_HTTP_PORT}:9380- 80:80- 443:443
# to
ports:- ${SVR_HTTP_PORT}:9380- 8880:80- 4443:443
url: http://localhost:8880/login
Running Ollama
I changed the port and found something…
this is my ollama service config file:
[Unit]
Description=Ollama Service
After=network-online.target[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"
Environment="OLLAMA_HOST=0.0.0.0:11451"
OLLAMA_SCHED_SPREAD=1[Install]
WantedBy=default.target
I need to run ollama like this:OLLAMA_HOST=127.0.0.1:11451 ollama run qwq
, it works, but why???
It also need a embedding model:
OLLAMA_HOST=127.0.0.1:11451 ollama pull shaw/dmeta-embedding-zh
but still can not config embedding model in ragflow page.
try: modify .env
# from
RAGFLOW_IMAGE=registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:v0.17.2-slim
# to
RAGFLOW_IMAGE=registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:v0.17.2
Reference:
- RagFlow 部署指南 - 直接拉取镜像