You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. ---
  2. sidebar_position: 1
  3. slug: /configurations
  4. ---
  5. # Configuration
  6. Configurations for deploying RAGFlow via Docker.
  7. ## Guidelines
  8. When it comes to system configurations, you will need to manage the following files:
  9. - [.env](https://github.com/infiniflow/ragflow/blob/main/docker/.env): Contains important environment variables for Docker.
  10. - [service_conf.yaml.template](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml.template): Configures the back-end services. It specifies the system-level configuration for RAGFlow and is used by its API server and task executor. Upon container startup, the `service_conf.yaml` file will be generated based on this template file. This process replaces any environment variables within the template, allowing for dynamic configuration tailored to the container's environment.
  11. - [docker-compose.yml](https://github.com/infiniflow/ragflow/blob/main/docker/docker-compose.yml): The Docker Compose file for starting up the RAGFlow service.
  12. To update the default HTTP serving port (80), go to [docker-compose.yml](https://github.com/infiniflow/ragflow/blob/main/docker/docker-compose.yml) and change `80:80`
  13. to `<YOUR_SERVING_PORT>:80`.
  14. :::tip NOTE
  15. Updates to the above configurations require a reboot of all containers to take effect:
  16. ```bash
  17. docker compose -f docker/docker-compose.yml up -d
  18. ```
  19. :::
  20. ## Docker Compose
  21. - **docker-compose.yml**
  22. Sets up environment for RAGFlow and its dependencies.
  23. - **docker-compose-base.yml**
  24. Sets up environment for RAGFlow's dependencies: Elasticsearch/[Infinity](https://github.com/infiniflow/infinity), MySQL, MinIO, and Redis.
  25. :::danger IMPORTANT
  26. We do not actively maintain **docker-compose-CN-oc9.yml**, **docker-compose-gpu-CN-oc9.yml**, or **docker-compose-gpu.yml**, so use them at your own risk. However, you are welcome to file a pull request to improve any of them.
  27. :::
  28. ## Docker environment variables
  29. The [.env](https://github.com/infiniflow/ragflow/blob/main/docker/.env) file contains important environment variables for Docker.
  30. ### Elasticsearch
  31. - `STACK_VERSION`
  32. The version of Elasticsearch. Defaults to `8.11.3`
  33. - `ES_PORT`
  34. The port used to expose the Elasticsearch service to the host machine, allowing **external** access to the service running inside the Docker container. Defaults to `1200`.
  35. - `ELASTIC_PASSWORD`
  36. The password for Elasticsearch.
  37. ### Kibana
  38. - `KIBANA_PORT`
  39. The port used to expose the Kibana service to the host machine, allowing **external** access to the service running inside the Docker container. Defaults to `6601`.
  40. - `KIBANA_USER`
  41. The username for Kibana. Defaults to `rag_flow`.
  42. - `KIBANA_PASSWORD`
  43. The password for Kibana. Defaults to `infini_rag_flow`.
  44. ### Resource management
  45. - `MEM_LIMIT`
  46. The maximum amount of the memory, in bytes, that *a specific* Docker container can use while running. Defaults to `8073741824`.
  47. ### MySQL
  48. - `MYSQL_PASSWORD`
  49. The password for MySQL.
  50. - `MYSQL_PORT`
  51. The port used to expose the MySQL service to the host machine, allowing **external** access to the MySQL database running inside the Docker container. Defaults to `5455`.
  52. ### MinIO
  53. RAGFlow utilizes MinIO as its object storage solution, leveraging its scalability to store and manage all uploaded files.
  54. - `MINIO_CONSOLE_PORT`
  55. The port used to expose the MinIO console interface to the host machine, allowing **external** access to the web-based console running inside the Docker container. Defaults to `9001`
  56. - `MINIO_PORT`
  57. The port used to expose the MinIO API service to the host machine, allowing **external** access to the MinIO object storage service running inside the Docker container. Defaults to `9000`.
  58. - `MINIO_USER`
  59. The username for MinIO.
  60. - `MINIO_PASSWORD`
  61. The password for MinIO.
  62. ### Redis
  63. - `REDIS_PORT`
  64. The port used to expose the Redis service to the host machine, allowing **external** access to the Redis service running inside the Docker container. Defaults to `6379`.
  65. - `REDIS_PASSWORD`
  66. The password for Redis.
  67. ### RAGFlow
  68. - `SVR_HTTP_PORT`
  69. The port used to expose RAGFlow's HTTP API service to the host machine, allowing **external** access to the service running inside the Docker container. Defaults to `9380`.
  70. - `RAGFLOW-IMAGE`
  71. The Docker image edition. Available editions:
  72. - `infiniflow/ragflow:v0.20.4-slim` (default): The RAGFlow Docker image without embedding models.
  73. - `infiniflow/ragflow:v0.20.4`: The RAGFlow Docker image with embedding models including:
  74. - Built-in embedding models:
  75. - `BAAI/bge-large-zh-v1.5`
  76. - `maidalun1020/bce-embedding-base_v1`
  77. :::tip NOTE
  78. If you cannot download the RAGFlow Docker image, try the following mirrors.
  79. - For the `nightly-slim` edition:
  80. - `RAGFLOW_IMAGE=swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow:nightly-slim` or,
  81. - `RAGFLOW_IMAGE=registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:nightly-slim`.
  82. - For the `nightly` edition:
  83. - `RAGFLOW_IMAGE=swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow:nightly` or,
  84. - `RAGFLOW_IMAGE=registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:nightly`.
  85. :::
  86. ### Timezone
  87. - `TIMEZONE`
  88. The local time zone. Defaults to `'Asia/Shanghai'`.
  89. ### Hugging Face mirror site
  90. - `HF_ENDPOINT`
  91. The mirror site for huggingface.co. It is disabled by default. You can uncomment this line if you have limited access to the primary Hugging Face domain.
  92. ### MacOS
  93. - `MACOS`
  94. Optimizations for macOS. It is disabled by default. You can uncomment this line if your OS is macOS.
  95. ### User registration
  96. - `REGISTER_ENABLED`
  97. - `1`: (Default) Enable user registration.
  98. - `0`: Disable user registration.
  99. ## Service configuration
  100. [service_conf.yaml.template](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml.template) specifies the system-level configuration for RAGFlow and is used by its API server and task executor.
  101. ### `ragflow`
  102. - `host`: The API server's IP address inside the Docker container. Defaults to `0.0.0.0`.
  103. - `port`: The API server's serving port inside the Docker container. Defaults to `9380`.
  104. ### `mysql`
  105. - `name`: The MySQL database name. Defaults to `rag_flow`.
  106. - `user`: The username for MySQL.
  107. - `password`: The password for MySQL.
  108. - `port`: The MySQL serving port inside the Docker container. Defaults to `3306`.
  109. - `max_connections`: The maximum number of concurrent connections to the MySQL database. Defaults to `100`.
  110. - `stale_timeout`: Timeout in seconds.
  111. ### `minio`
  112. - `user`: The username for MinIO.
  113. - `password`: The password for MinIO.
  114. - `host`: The MinIO serving IP *and* port inside the Docker container. Defaults to `minio:9000`.
  115. ### `oauth`
  116. The OAuth configuration for signing up or signing in to RAGFlow using a third-party account.
  117. - `<channel>`: Custom channel ID.
  118. - `type`: Authentication type, options include `oauth2`, `oidc`, `github`. Default is `oauth2`, when `issuer` parameter is provided, defaults to `oidc`.
  119. - `icon`: Icon ID, options include `github`, `sso`, default is `sso`.
  120. - `display_name`: Channel name, defaults to the Title Case format of the channel ID.
  121. - `client_id`: Required, unique identifier assigned to the client application.
  122. - `client_secret`: Required, secret key for the client application, used for communication with the authentication server.
  123. - `authorization_url`: Base URL for obtaining user authorization.
  124. - `token_url`: URL for exchanging authorization code and obtaining access token.
  125. - `userinfo_url`: URL for obtaining user information (username, email, etc.).
  126. - `issuer`: Base URL of the identity provider. OIDC clients can dynamically obtain the identity provider's metadata (`authorization_url`, `token_url`, `userinfo_url`) through `issuer`.
  127. - `scope`: Requested permission scope, a space-separated string. For example, `openid profile email`.
  128. - `redirect_uri`: Required, URI to which the authorization server redirects during the authentication flow to return results. Must match the callback URI registered with the authentication server. Format: `https://your-app.com/v1/user/oauth/callback/<channel>`. For local configuration, you can directly use `http://127.0.0.1:80/v1/user/oauth/callback/<channel>`.
  129. :::tip NOTE
  130. The following are best practices for configuring various third-party authentication methods. You can configure one or multiple third-party authentication methods for Ragflow:
  131. ```yaml
  132. oauth:
  133. oauth2:
  134. display_name: "OAuth2"
  135. client_id: "your_client_id"
  136. client_secret: "your_client_secret"
  137. authorization_url: "https://your-oauth-provider.com/oauth/authorize"
  138. token_url: "https://your-oauth-provider.com/oauth/token"
  139. userinfo_url: "https://your-oauth-provider.com/oauth/userinfo"
  140. redirect_uri: "https://your-app.com/v1/user/oauth/callback/oauth2"
  141. oidc:
  142. display_name: "OIDC"
  143. client_id: "your_client_id"
  144. client_secret: "your_client_secret"
  145. issuer: "https://your-oauth-provider.com/oidc"
  146. scope: "openid email profile"
  147. redirect_uri: "https://your-app.com/v1/user/oauth/callback/oidc"
  148. github:
  149. # https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app
  150. type: "github"
  151. icon: "github"
  152. display_name: "Github"
  153. client_id: "your_client_id"
  154. client_secret: "your_client_secret"
  155. redirect_uri: "https://your-app.com/v1/user/oauth/callback/github"
  156. ```
  157. :::
  158. ### `user_default_llm`
  159. The default LLM to use for a new RAGFlow user. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml.template**.
  160. - `factory`: The LLM supplier. Available options:
  161. - `"OpenAI"`
  162. - `"DeepSeek"`
  163. - `"Moonshot"`
  164. - `"Tongyi-Qianwen"`
  165. - `"VolcEngine"`
  166. - `"ZHIPU-AI"`
  167. - `api_key`: The API key for the specified LLM. You will need to apply for your model API key online.
  168. :::tip NOTE
  169. If you do not set the default LLM here, configure the default LLM on the **Settings** page in the RAGFlow UI.
  170. :::