How could I run dify locally with ollama without internet? #8841

Closed
opened 2026-02-21 18:28:04 -05:00 by yindo · 5 comments
Owner

Originally created by @quzhixue-Kimi on GitHub (Mar 2, 2025).

Self Checks

  • 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.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

hi there,

I am trying to test the multiple AI flow tools with dify, flowise, ragflow and etc.

But, there will not be any internet with my network environment. What I need to do is to download all the docker images, docker-compose.yaml file and your latest ollama plugin via https://marketplace.dify.ai/plugins/langgenius/ollama

Copying all these above dependencies to my prod ubuntu server.

For installing flowise, ragflow, ollama and ollama models, I need to download these components with my local ubuntu server, then copying them to prod ubuntu server.

2. Additional context or comments

Currently, the latest github repository has been downloaded and all docker containers have been pulled and saved.

The ollama server ran successfully and models have been started up.

But, during installing the ollama plugin with the 1.0.0 dify. There is one internet issue occurred installation.

I do not have the internet with my prod environment.

It is appreciated that you could have a virtual env to install the ollama plugin without internet and, tell me how to resolve the issue.

BR
Kimi

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @quzhixue-Kimi on GitHub (Mar 2, 2025). ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. hi there, I am trying to test the multiple AI flow tools with dify, flowise, ragflow and etc. But, there will not be any internet with my network environment. What I need to do is to download all the docker images, docker-compose.yaml file and your latest ollama plugin via https://marketplace.dify.ai/plugins/langgenius/ollama Copying all these above dependencies to my prod ubuntu server. For installing flowise, ragflow, ollama and ollama models, I need to download these components with my local ubuntu server, then copying them to prod ubuntu server. ### 2. Additional context or comments Currently, the latest github repository has been downloaded and all docker containers have been pulled and saved. The ollama server ran successfully and models have been started up. But, during installing the ollama plugin with the 1.0.0 dify. There is one internet issue occurred installation. I do not have the internet with my prod environment. It is appreciated that you could have a virtual env to install the ollama plugin without internet and, tell me how to resolve the issue. BR Kimi ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🙋‍♂️ question label 2026-02-21 18:28:04 -05:00
yindo closed this issue 2026-02-21 18:28:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 2, 2025):

Hello, @quzhixue-Kimi! I'm here to help you with any bugs, questions, or contributions you may have regarding the dify tool. Let's work together to find a solution while we wait for a human maintainer.

To run Dify locally with Ollama without an internet connection, you can follow these steps:

  1. Download and Start Ollama:

    • Download the Ollama client for your system from the Ollama download page.
    • Run Ollama with the desired model, for example:
      ollama run deepseek-r1:7b
      
    • This will start an API service locally on port 11434, accessible via http://localhost:11434.
  2. Configure Dify to Use Ollama:

    • In Dify, go to Settings > Model Providers > Ollama and fill in the following:
      • Model Name: deepseek-r1:7b
      • Base URL: http://<your-ollama-endpoint-domain>:11434 (use http://localhost:11434 for local source deployment or http://host.docker.internal:11434 for Docker deployment)
      • Model Type: 对话
      • Model Context Length: 32768
      • Max Token Limit: 32768
      • Supports Vision: Yes (if applicable)
  3. Expose Ollama Service:

    • If using Docker, ensure Ollama is accessible by setting the environment variable to expose it to the network:
      • On macOS, use:
        launchctl setenv OLLAMA_HOST "0.0.0.0"
        
      • On Linux, edit the systemd service:
        [Service]
        Environment="OLLAMA_HOST=0.0.0.0"
        
        Then reload and restart the service:
        systemctl daemon-reload
        systemctl restart ollama
        
      • On Windows, set the environment variable through the system settings.

For the installation issue of the Ollama plugin in a production environment without internet access, you can use the 'Local Upload' method to install the plugin. Package the plugin into a .difypkg file and upload it manually through the 'Install via Local File' option on the Dify plugin management page. This method is suitable for offline machines and environments where direct downloads fail [1][2].

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 (Mar 2, 2025): <!-- Greeting --> Hello, @quzhixue-Kimi! I'm here to help you with any bugs, questions, or contributions you may have regarding the dify tool. Let's work together to find a solution while we wait for a human maintainer. <!-- Answer --> To run Dify locally with Ollama without an internet connection, you can follow these steps: 1. **Download and Start Ollama:** - Download the Ollama client for your system from the [Ollama download page](https://ollama.com/download). - Run Ollama with the desired model, for example: ```bash ollama run deepseek-r1:7b ``` - This will start an API service locally on port 11434, accessible via `http://localhost:11434`. 2. **Configure Dify to Use Ollama:** - In Dify, go to `Settings > Model Providers > Ollama` and fill in the following: - Model Name: `deepseek-r1:7b` - Base URL: `http://<your-ollama-endpoint-domain>:11434` (use `http://localhost:11434` for local source deployment or `http://host.docker.internal:11434` for Docker deployment) - Model Type: `对话` - Model Context Length: `32768` - Max Token Limit: `32768` - Supports Vision: `Yes` (if applicable) 3. **Expose Ollama Service:** - If using Docker, ensure Ollama is accessible by setting the environment variable to expose it to the network: - On macOS, use: ```bash launchctl setenv OLLAMA_HOST "0.0.0.0" ``` - On Linux, edit the systemd service: ```ini [Service] Environment="OLLAMA_HOST=0.0.0.0" ``` Then reload and restart the service: ```bash systemctl daemon-reload systemctl restart ollama ``` - On Windows, set the environment variable through the system settings. For the installation issue of the Ollama plugin in a production environment without internet access, you can use the 'Local Upload' method to install the plugin. Package the plugin into a `.difypkg` file and upload it manually through the 'Install via Local File' option on the Dify plugin management page. This method is suitable for offline machines and environments where direct downloads fail <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/development/models-integration/ollama.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/learn-more/use-cases/private-ai-ollama-deepseek-dify.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/7d56c50a-aa2f-4540-bc71-4f22c2cbc39d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7d56c50a-aa2f-4540-bc71-4f22c2cbc39d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7d56c50a-aa2f-4540-bc71-4f22c2cbc39d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7d56c50a-aa2f-4540-bc71-4f22c2cbc39d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7d56c50a-aa2f-4540-bc71-4f22c2cbc39d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7d56c50a-aa2f-4540-bc71-4f22c2cbc39d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7d56c50a-aa2f-4540-bc71-4f22c2cbc39d?feedback_type=other)</sup>
Author
Owner

@quzhixue-Kimi commented on GitHub (Mar 2, 2025):

hi @dosu

I have done with your steps, but it failed to install the ollama plugin.

BR
Kimi

@quzhixue-Kimi commented on GitHub (Mar 2, 2025): hi @dosu I have done with your steps, but it failed to install the ollama plugin. BR Kimi
Author
Owner

@dosubot[bot] commented on GitHub (Mar 2, 2025):

To resolve the issue of failing to install the Ollama plugin, ensure that the Ollama service is accessible from the Docker container. If you encounter a connection error, follow these steps:

  1. Expose the Ollama Service:

    • On macOS, set the environment variable using launchctl:
      launchctl setenv OLLAMA_HOST "0.0.0.0"
      
    • Restart the Ollama application.
  2. Modify the Service URL:

    • Replace localhost with host.docker.internal in the service URL:
      http://host.docker.internal:11434
      
  3. Check Network Connectivity:

    • If you're using a proxy like Clash, enable global TUN mode to resolve installation timeout issues.
  4. Downgrade Dify Services:

    • If the installation fails with a timeout error during dependency installation, modify the docker-compose.yaml file to downgrade both dify-api and dify-web services to version 0.15.3. This can help in successfully adding Ollama models [1][2][3].

These steps should help resolve the connection and timeout issues when installing the Ollama plugin. If the installation appears successful but the plugin doesn't work, check the Docker compose logs for network connectivity issues.

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 (Mar 2, 2025): <!-- Answer --> To resolve the issue of failing to install the Ollama plugin, ensure that the Ollama service is accessible from the Docker container. If you encounter a connection error, follow these steps: 1. **Expose the Ollama Service**: - On macOS, set the environment variable using `launchctl`: ```bash launchctl setenv OLLAMA_HOST "0.0.0.0" ``` - Restart the Ollama application. 2. **Modify the Service URL**: - Replace `localhost` with `host.docker.internal` in the service URL: ```bash http://host.docker.internal:11434 ``` 3. **Check Network Connectivity**: - If you're using a proxy like Clash, enable global TUN mode to resolve installation timeout issues. 4. **Downgrade Dify Services**: - If the installation fails with a timeout error during dependency installation, modify the `docker-compose.yaml` file to downgrade both `dify-api` and `dify-web` services to version 0.15.3. This can help in successfully adding Ollama models <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/development/models-integration/ollama.md)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/14535)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/14566)</sup>. These steps should help resolve the connection and timeout issues when installing the Ollama plugin. If the installation appears successful but the plugin doesn't work, check the Docker compose logs for network connectivity issues. <!-- 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/801cd24b-d58a-485b-9171-1d341b701b95?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/801cd24b-d58a-485b-9171-1d341b701b95?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/801cd24b-d58a-485b-9171-1d341b701b95?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/801cd24b-d58a-485b-9171-1d341b701b95?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/801cd24b-d58a-485b-9171-1d341b701b95?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/801cd24b-d58a-485b-9171-1d341b701b95?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/801cd24b-d58a-485b-9171-1d341b701b95?feedback_type=other)</sup>
Author
Owner

@quzhixue-Kimi commented on GitHub (Mar 2, 2025):

Hi @dosu,

I just want to use the 1.0.0 version of dify to check what are the latest features.
I could use the 0.15.3 version with ollama directly.

It is a little confusing that the latest version could not use the ollama or the other model providers directly.

Could you please try to find the other solution to resolve the issue later? Installing the ollama plugin with the latest dify?

BR
Kimi

@quzhixue-Kimi commented on GitHub (Mar 2, 2025): Hi @dosu, I just want to use the 1.0.0 version of dify to check what are the latest features. I could use the 0.15.3 version with ollama directly. It is a little confusing that the latest version could not use the ollama or the other model providers directly. Could you please try to find the other solution to resolve the issue later? Installing the ollama plugin with the latest dify? BR Kimi
Author
Owner

@dosubot[bot] commented on GitHub (Mar 2, 2025):

To use the Ollama plugin with Dify version 1.0.0, you can try the following steps:

  1. Local Upload Method: Since you're working in an offline environment, package the Ollama plugin into a .difypkg file and manually upload it through the 'Install via Local File' option on the Dify plugin management page. This method is suitable for environments without internet access [1].

  2. Disable Plugin Signature Verification: If you encounter a signature verification error, add FORCE_VERIFYING_SIGNATURE=false to your .env file. This will allow you to install plugins that are not verified in the Dify Marketplace. However, ensure you test these plugins in a sandbox environment first for safety [2].

  3. Network Configuration: Ensure that the Ollama service is correctly exposed to the network. If using Docker, replace localhost with host.docker.internal in the service URL to ensure the Docker container can access the Ollama service [3].

These steps should help you install and use the Ollama plugin with Dify version 1.0.0. If you continue to face issues, checking the Docker logs for any network-related errors might provide additional insights.

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 (Mar 2, 2025): <!-- Answer --> To use the Ollama plugin with Dify version 1.0.0, you can try the following steps: 1. **Local Upload Method**: Since you're working in an offline environment, package the Ollama plugin into a `.difypkg` file and manually upload it through the 'Install via Local File' option on the Dify plugin management page. This method is suitable for environments without internet access <sup>[[1]](https://github.com/langgenius/dify/issues/14582)</sup>. 2. **Disable Plugin Signature Verification**: If you encounter a signature verification error, add `FORCE_VERIFYING_SIGNATURE=false` to your `.env` file. This will allow you to install plugins that are not verified in the Dify Marketplace. However, ensure you test these plugins in a sandbox environment first for safety <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/learn-more/faq/plugins.md)</sup>. 3. **Network Configuration**: Ensure that the Ollama service is correctly exposed to the network. If using Docker, replace `localhost` with `host.docker.internal` in the service URL to ensure the Docker container can access the Ollama service <sup>[[3]](https://github.com/langgenius/dify/issues/13777)</sup>. These steps should help you install and use the Ollama plugin with Dify version 1.0.0. If you continue to face issues, checking the Docker logs for any network-related errors might provide additional insights. <!-- 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/4749cb2e-cf9f-4772-9461-1044334eea26?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/4749cb2e-cf9f-4772-9461-1044334eea26?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/4749cb2e-cf9f-4772-9461-1044334eea26?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/4749cb2e-cf9f-4772-9461-1044334eea26?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4749cb2e-cf9f-4772-9461-1044334eea26?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/4749cb2e-cf9f-4772-9461-1044334eea26?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4749cb2e-cf9f-4772-9461-1044334eea26?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8841