时间:2025-11-11 10:28
人气:
作者:admin
本文档整理并规范了在 WSL2 Ubuntu 22.04 环境下部署与启动 RAGFlow 的步骤,包括前端、后端与中间件,以及常见问题的处理方式。文档内容由大模型进行了重新排版。
>= 18(示例使用 v20.19.5)3.10git clone https://github.com/infiniflow/ragflow.git
cd ragflow
cd web
npm install
npm run dev
启动时可能出现如下错误:
error - [plugin: ./node_modules/@umijs/plugins/dist/tailwindcss] tailwindcss generate failed after 5 seconds, please check your tailwind.css and tailwind.config.js
处理办法:增大超时时间
vi ./node_modules/@umijs/plugins/dist/tailwindcss.js
将第 29 行的 CHECK_TIMEOUT_UNIT_SECOND 值调整为 50,保存后重新运行:
npm run dev
(参考截图)




在项目根目录下运行:
docker compose -f docker/docker-compose-base.yml up -d
uv):uv sync --python 3.10
PYTHONPATH:source .venv/bin/activate
export PYTHONPATH=$(pwd)
export HF_ENDPOINT=https://hf-mirror.com
在 Linux/WSL 环境下,推荐预加载 jemalloc 改善内存分配性能:
JEMALLOC_PATH=$(pkg-config --variable=libdir jemalloc)/libjemalloc.so
LD_PRELOAD=$JEMALLOC_PATH python rag/svr/task_executor.py 1
1 为执行器编号,用于区分多个并发执行器实例。启动后端服务:
python api/ragflow_server.py
cd ragflow/
uv run download_deps.py --china-mirrors
python3 download_deps.py --china-mirrors
docker build -f Dockerfile.deps -t infiniflow/ragflow_deps .
docker build --build-arg LIGHTEN=1 --build-arg NEED_MIRROR=1 -f Dockerfile -t infiniflow/ragflow:nightly-slim_v1 .
docker compose -f docker/docker-compose-base.yml up -d
Resource punkt_tab not found.
Please use the NLTK Downloader to obtain the resource:
>>> import nltk
>>> nltk.download('punkt_tab')
For more information see: https://www.nltk.org/data.html
Attempted to load tokenizers/punkt_tab/english/
Searched in:
- '/root/nltk_data'
- '/mnt/e/workspace/github/ragflow_gat/ragflow-0.21.1/.venv/nltk_data'
- '/mnt/e/workspace/github/ragflow_gat/ragflow-0.21.1/.venv/share/nltk_data'
- '/mnt/e/workspace/github/ragflow_gat/ragflow-0.21.1/.venv/lib/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
解决方法:
从其他地方下载nltk(比如其他博主提供的百度云盘资源),将文件放在上文报错信息中指定的路径下(任意一个路径即可,例如我放在了/root下)。

2)uv run download_deps.py下载谷歌驱动时超时
解决方法:
python3 download_deps.py --china-mirrors
Dockerfile:2
--------------------
1 | # base stage
2 | >>> FROM ubuntu:22.04 AS base
3 | USER root
4 | SHELL ["/bin/bash", "-c"]
--------------------
ERROR: failed to build: failed to solve: failed to fetch anonymous token: Get "https://auth.docker.io/token?scope=repository%3Alibrary%2Fubuntu%3Apull&service=registry.docker.io": dial tcp 199.59.148.102:443: i/o timeout
解决方法:
挂梯子以后单独拉取ubuntu:22.04镜像后再重新执行构建
docker pull ubuntu:22.04
ERROR: failed to build: failed to solve: process "/bin/bash -c cp /huggingface.co/InfiniFlow/huqie/huqie.txt.trie /ragflow/rag/res/ && tar --exclude='.*' -cf - /huggingface.co/InfiniFlow/text_concat_xgb_v1.0 /huggingface.co/InfiniFlow/deepdoc | tar -xf - --strip-components=3 -C /ragflow/rag/res/deepdoc" did not complete successfully: exit code: 1
解决方法:重新执行download_deps.py脚本
uv run download_deps.py --china-mirrors
本文来自博客园,作者:日报初级开发工程师,转载请注明原文链接:https://www.cnblogs.com/april-code/p/19209129