[GH-ISSUE #6550] Cannot download models behind a proxy in docker ollama. #29879

Closed
opened 2026-04-22 09:10:01 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @lakshmikanthgr on GitHub (Aug 29, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6550

What is the issue?

Able to run the ollama in docker container in my high end machine which has ubuntu os. But i am not able to pull any model. I am getting

image

OS

Docker

GPU

AMD

CPU

Intel

Ollama version

No response

Originally created by @lakshmikanthgr on GitHub (Aug 29, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6550 ### What is the issue? Able to run the ollama in docker container in my high end machine which has ubuntu os. But i am not able to pull any model. I am getting ![image](https://github.com/user-attachments/assets/dd271879-a5d2-43d7-b522-6b99718ac54d) ### OS Docker ### GPU AMD ### CPU Intel ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-22 09:10:01 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 29, 2024):

Replace proxy.example.com with the name of your proxy.

If you need more specific instructions, add more information about your configuration.

<!-- gh-comment-id:2317158912 --> @rick-github commented on GitHub (Aug 29, 2024): Replace `proxy.example.com` with the name of your proxy. If you need more specific instructions, add more information about your configuration.
Author
Owner

@lakshmikanthgr commented on GitHub (Aug 29, 2024):

Offcourse i have added the proxy. Infact i was not able to run the docker with out it
export http_proxy=http://your-proxy:port
export https_proxy=https://your-proxy:port.

However i was not able to pull model, I dont think so ollama supports extra parameters to pass the proxy as a parameter.

<!-- gh-comment-id:2317272112 --> @lakshmikanthgr commented on GitHub (Aug 29, 2024): Offcourse i have added the proxy. Infact i was not able to run the docker with out it export http_proxy=http://your-proxy:port export https_proxy=https://your-proxy:port. However i was not able to pull model, I dont think so ollama supports extra parameters to pass the proxy as a parameter.
Author
Owner

@rick-github commented on GitHub (Aug 29, 2024):

Not sure what "supports extra parameters to pass the proxy as a parameter" means. You configure the proxy inside the container and you don't set any proxy configuration for the ollama client. You don't need to pass the proxy as a parameter.

The error message says lookup proxy.example.com on 127.0.0.53:53: no such host. That means your ollama server is configured to connect to proxy.example.com for proxy connections, ie https_proxy=https://proxy.example.com. You need to change proxy.example.com in the configuration in the container to point at your real proxy server.

If you provide the docker commands or docker-compose.yaml that you use to start your ollama container, it may provide more insight. Server logs (docker logs ollama) may also help.

<!-- gh-comment-id:2317301456 --> @rick-github commented on GitHub (Aug 29, 2024): Not sure what "supports extra parameters to pass the proxy as a parameter" means. You configure the proxy inside the container and you don't set any proxy configuration for the ollama client. You don't need to pass the proxy as a parameter. The error message says `lookup proxy.example.com on 127.0.0.53:53: no such host`. That means your ollama server is configured to connect to `proxy.example.com` for proxy connections, ie `https_proxy=https://proxy.example.com`. You need to change `proxy.example.com` in the configuration in the container to point at your real proxy server. If you provide the docker commands or docker-compose.yaml that you use to start your ollama container, it may provide more insight. Server logs (`docker logs ollama`) may also help.
Author
Owner

@lakshmikanthgr commented on GitHub (Aug 29, 2024):

By unsetting HTTP_PROXY i was able to pull the model. I am not completely what would have been caused if we have set this variable.

My understanding is by setting HTTP_PROXY, we are asking all your internal requests that could localhost that connect inside the docker or also communication betweeen docker and ollama to go through the specified server. However its an extra burder and those communication are not really designed to go through extra servers. That could eventually causing the time out errors/failure.

Since I am able to pull model in the docker container. I will mark this snag as closed.

<!-- gh-comment-id:2317660996 --> @lakshmikanthgr commented on GitHub (Aug 29, 2024): By unsetting HTTP_PROXY i was able to pull the model. I am not completely what would have been caused if we have set this variable. My understanding is by setting HTTP_PROXY, we are asking all your internal requests that could localhost that connect inside the docker or also communication betweeen docker and ollama to go through the specified server. However its an extra burder and those communication are not really designed to go through extra servers. That could eventually causing the time out errors/failure. Since I am able to pull model in the docker container. I will mark this snag as closed.
Author
Owner

@lakshmikanthgr commented on GitHub (Aug 29, 2024):

By unsetting HTTP_PROXY i was able to pull the model. I am not completely what would have been caused if we have set this variable.

My understanding is by setting HTTP_PROXY, we are asking all your internal requests that could localhost that connect inside the docker or also communication betweeen docker and ollama to go through the specified server. However its an extra burder and those communication are not really designed to go through extra servers. That could eventually causing the time out errors/failure.

Since I am able to pull model in the docker container. I will mark this snag as closed.

<!-- gh-comment-id:2317661209 --> @lakshmikanthgr commented on GitHub (Aug 29, 2024): By unsetting HTTP_PROXY i was able to pull the model. I am not completely what would have been caused if we have set this variable. My understanding is by setting HTTP_PROXY, we are asking all your internal requests that could localhost that connect inside the docker or also communication betweeen docker and ollama to go through the specified server. However its an extra burder and those communication are not really designed to go through extra servers. That could eventually causing the time out errors/failure. Since I am able to pull model in the docker container. I will mark this snag as closed.
Author
Owner

@gaby commented on GitHub (Aug 30, 2024):

@lakshmikanthgr I just tried this and it doesnt work. My ollama has no internet access if I only specify the "HTTPS_PROXY" it sends a request to "http://registry.ollama.ai" which fails with DNS lookup.

The pull request never make it to the proxy. I've been stuck over a month trying to use ollama because of lack of proper proxy support

<!-- gh-comment-id:2321090752 --> @gaby commented on GitHub (Aug 30, 2024): @lakshmikanthgr I just tried this and it doesnt work. My ollama has no internet access if I only specify the "HTTPS_PROXY" it sends a request to "http://registry.ollama.ai" which fails with DNS lookup. The pull request never make it to the proxy. I've been stuck over a month trying to use ollama because of lack of proper proxy support
Author
Owner

@rick-github commented on GitHub (Aug 30, 2024):

@gaby Server logs will aid in debugging, as will a description of your environment and ollama deployment.

<!-- gh-comment-id:2321360187 --> @rick-github commented on GitHub (Aug 30, 2024): @gaby [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) will aid in debugging, as will a description of your environment and ollama deployment.
Author
Owner

@lakshmikanthgr commented on GitHub (Sep 22, 2024):

@lakshmikanthgr I just tried this and it doesnt work. My ollama has no internet access if I only specify the "HTTPS_PROXY" it sends a request to "http://registry.ollama.ai" which fails with DNS lookup.

The pull request never make it to the proxy. I've been stuck over a month trying to use ollama because of lack of proper proxy support

I am sorry for late reply, Could you try with --insecure option: Something like ollama pull phi --insecure.

<!-- gh-comment-id:2366829678 --> @lakshmikanthgr commented on GitHub (Sep 22, 2024): > @lakshmikanthgr I just tried this and it doesnt work. My ollama has no internet access if I only specify the "HTTPS_PROXY" it sends a request to "http://registry.ollama.ai" which fails with DNS lookup. > > The pull request never make it to the proxy. I've been stuck over a month trying to use ollama because of lack of proper proxy support I am sorry for late reply, Could you try with --insecure option: Something like ollama pull phi --insecure.
Author
Owner

@gaby commented on GitHub (Sep 22, 2024):

I still can't get it to work. I use open-webui which runs OLLAMA inside.

No matter which combination I get a different error from OLLAMA

<!-- gh-comment-id:2366864844 --> @gaby commented on GitHub (Sep 22, 2024): I still can't get it to work. I use `open-webui` which runs OLLAMA inside. No matter which combination I get a different error from OLLAMA
Author
Owner

@rick-github commented on GitHub (Sep 22, 2024):

@gaby Server logs will aid in debugging, as will a description of your environment and ollama deployment.

<!-- gh-comment-id:2367003321 --> @rick-github commented on GitHub (Sep 22, 2024): @gaby [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) will aid in debugging, as will a description of your environment and ollama deployment.
Author
Owner

@jazzshu commented on GitHub (Feb 24, 2025):

Faced the same issue and managed to resolve in this way:
(I'm using AlmaLinux on WSL)
Ran Ollama on docker with:

 docker run --rm -d --name ollama \
  -p 11434:11434 \
  -e HTTP_PROXY="http://my-company-proxy.com:8080" \
  -e HTTPS_PROXY="http://my-company-proxy.com:8080" \
  -v ollama:/root/.ollama \
  ollama/ollama

Verify it works with:
curl http://localhost:11434/api/tags

Exec into the container and unset HTTP_PROXY env var:
docker exec -it ollama sh
-> unset HTTP_PROXY
-> ollama pull mistral

exit container and test your model

<!-- gh-comment-id:2677876603 --> @jazzshu commented on GitHub (Feb 24, 2025): Faced the same issue and managed to resolve in this way: (I'm using AlmaLinux on WSL) Ran Ollama on docker with: ```bash docker run --rm -d --name ollama \ -p 11434:11434 \ -e HTTP_PROXY="http://my-company-proxy.com:8080" \ -e HTTPS_PROXY="http://my-company-proxy.com:8080" \ -v ollama:/root/.ollama \ ollama/ollama ``` Verify it works with: curl http://localhost:11434/api/tags Exec into the container and unset HTTP_PROXY env var: docker exec -it ollama sh -> unset HTTP_PROXY -> ollama pull mistral exit container and test your model
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#29879