Unable to specify Milvus database via .env when launching Dify with Docker Compose #13312

Closed
opened 2026-02-21 19:11:35 -05:00 by yindo · 2 comments
Owner

Originally created by @jiawei5807 on GitHub (Apr 24, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @jiawei5807 on GitHub (Apr 24, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/3ee0b70b-03b9-48b8-9671-ea542a17a0d9) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:11:35 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 24, 2025):

Hello @jiawei5807! I'm Dosu, a bot here to help you with bugs, answer questions, and guide you towards becoming a contributor. I'm ready to assist you while you wait for a human maintainer. Let's get started!

To specify the Milvus database using a .env file when launching Dify with Docker Compose in a self-hosted environment, you should follow these steps:

  1. Environment Setup:

    • Navigate to the docker directory.
    • Copy the .env.example file to a new file named .env by running cp .env.example .env.
    • Customize the .env file with the following settings to configure the Milvus database:
    VECTOR_STORE=milvus
    MILVUS_URI=http://milvus-standalone:19530
    MILVUS_TOKEN=
    MILVUS_USER=root
    MILVUS_PASSWORD=Milvus
    MILVUS_ENABLE_HYBRID_SEARCH=False
    
  2. Running the Services:

    • Execute docker compose up from the docker directory to start the services.
  3. Synchronize Environment Variables:

    • If there are updates to the .env.example file, ensure you synchronize these changes with your local .env file. Check all configuration items in the .env file to ensure they match your actual running environment. You may need to add new variables from .env.example to your .env file and update any changed values.

These settings will help establish the connection to the Milvus vector database. Make sure to set the VECTOR_STORE variable to milvus to specify Milvus as your vector database service [1][2][3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 24, 2025): <!-- Greeting --> Hello @jiawei5807! I'm [Dosu](https://dosu.dev), a bot here to help you with bugs, answer questions, and guide you towards becoming a contributor. I'm ready to assist you while you wait for a human maintainer. Let's get started! <!-- Answer --> To specify the Milvus database using a `.env` file when launching Dify with Docker Compose in a self-hosted environment, you should follow these steps: 1. **Environment Setup**: - Navigate to the `docker` directory. - Copy the `.env.example` file to a new file named `.env` by running `cp .env.example .env`. - Customize the `.env` file with the following settings to configure the Milvus database: ```plaintext VECTOR_STORE=milvus MILVUS_URI=http://milvus-standalone:19530 MILVUS_TOKEN= MILVUS_USER=root MILVUS_PASSWORD=Milvus MILVUS_ENABLE_HYBRID_SEARCH=False ``` 2. **Running the Services**: - Execute `docker compose up` from the `docker` directory to start the services. 3. **Synchronize Environment Variables**: - If there are updates to the `.env.example` file, ensure you synchronize these changes with your local `.env` file. Check all configuration items in the `.env` file to ensure they match your actual running environment. You may need to add new variables from `.env.example` to your `.env` file and update any changed values. These settings will help establish the connection to the Milvus vector database. Make sure to set the `VECTOR_STORE` variable to `milvus` to specify Milvus as your vector database service <sup>[[1]](https://github.com/langgenius/dify/issues/13240)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/README.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/getting-started/install-self-hosted/docker-compose.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/2505936c-ae6f-49fe-85d8-abcbcd359705?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2505936c-ae6f-49fe-85d8-abcbcd359705?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2505936c-ae6f-49fe-85d8-abcbcd359705?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2505936c-ae6f-49fe-85d8-abcbcd359705?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2505936c-ae6f-49fe-85d8-abcbcd359705?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/2505936c-ae6f-49fe-85d8-abcbcd359705?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2505936c-ae6f-49fe-85d8-abcbcd359705?feedback_type=other)</sup>
Author
Owner

@gemaochuan commented on GitHub (Apr 28, 2025):

I configured the. env file and selected Milvus as the database, but it did not take effect. The vector data is still stored in the Postgres database

@gemaochuan commented on GitHub (Apr 28, 2025): I configured the. env file and selected Milvus as the database, but it did not take effect. The vector data is still stored in the Postgres database
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13312