[GH-ISSUE #3436] [BUG]: Unable loading Ollama with dokcer Anythingllm (Ollama instance could not be reached or is not responding) #2216

Closed
opened 2026-02-22 18:28:41 -05:00 by yindo · 3 comments
Owner

Originally created by @ShokofehVS-castLabs on GitHub (Mar 10, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3436

How are you running AnythingLLM?

Docker (local)

What happened?

I installed the docker version of AnythingLLM:

  1. installed docker, yarn and node alongside
  2. docker pull mintplexlabs/anythingllm

-> The docker version is running on (http://localhost:3001)

I installed the docker version of Ollama and it is running on (http://localhost:11434/)

Are there known steps to reproduce?

  1. Create a new workspace
  2. Set Ollama as the Workspace LLM Provider
  3. Write some queries in the thread
    => Your Ollama instance could not be reached or is not responding. Please make sure it is running the API server and your connection information is correct in AnythingLLM.

I tested different ways written in documentations; set the fix IP for Ollama or install it on docker.

Originally created by @ShokofehVS-castLabs on GitHub (Mar 10, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3436 ### How are you running AnythingLLM? Docker (local) ### What happened? I installed the docker version of AnythingLLM: 1. installed docker, yarn and node alongside 2. docker pull mintplexlabs/anythingllm -> The docker version is running on (http://localhost:3001) I installed the docker version of Ollama and it is running on (http://localhost:11434/) ### Are there known steps to reproduce? 1. Create a new workspace 2. Set Ollama as the Workspace LLM Provider 3. Write some queries in the thread => Your Ollama instance could not be reached or is not responding. Please make sure it is running the API server and your connection information is correct in AnythingLLM. I tested different ways written in documentations; set the fix IP for Ollama or install it on docker.
yindo added the possible bug label 2026-02-22 18:28:41 -05:00
yindo closed this issue 2026-02-22 18:28:42 -05:00
Author
Owner

@echohye commented on GitHub (Mar 11, 2025):

I have also encountered this problem. Have you solved it yet

@echohye commented on GitHub (Mar 11, 2025): I have also encountered this problem. Have you solved it yet
Author
Owner

@timothycarambat commented on GitHub (Mar 11, 2025):

You are in docker. You cannot use localhost in AnythingLLM to reach the host since AnythingLLM is in a container. Localhost will reach inside of the same container.

You need to use host.docker.internal (Mac/Windows) or 172.17.0.1 on Linux machines using docker to reach out of the container to the host.

http://localhost:11434 -> http://host.docker.internal:11434

@shatfield4 please make a docs section on this https://docs.anythingllm.com/ollama-connection-troubleshooting specifically outlining thise on Docker deployments

@timothycarambat commented on GitHub (Mar 11, 2025): You are in docker. You cannot use `localhost` in AnythingLLM to reach the host since AnythingLLM is in a container. Localhost will reach _inside_ of the same container. You need to use `host.docker.internal` (Mac/Windows) or `172.17.0.1` on Linux machines using docker to reach out of the container to the host. `http://localhost:11434` -> `http://host.docker.internal:11434` @shatfield4 please make a docs section on this https://docs.anythingllm.com/ollama-connection-troubleshooting specifically outlining thise on Docker deployments
Author
Owner

@obvius360 commented on GitHub (Jan 18, 2026):

How are you running AnythingLLM?

Docker (local)

What happened?

I installed the docker version of AnythingLLM:

1. installed docker, yarn and node alongside

2. docker pull mintplexlabs/anythingllm

-> The docker version is running on (http://localhost:3001)

I installed the docker version of Ollama and it is running on (http://localhost:11434/)

Are there known steps to reproduce?

1. Create a new workspace

2. Set Ollama as the Workspace LLM Provider

3. Write some queries in the thread
   => Your Ollama instance could not be reached or is not responding. Please make sure it is running the API server and your connection information is correct in AnythingLLM.

I tested different ways written in documentations; set the fix IP for Ollama or install it on docker.

For me: Only this works:

Para configurar las variables de entorno de Ollama en Linux (cuando se usa el instalador estándar que crea un servicio de systemd), debes seguir estos pasos técnicos:

1. Editar el servicio de Ollama

Abre una terminal y ejecuta el siguiente comando. Esto abrirá un archivo de configuración especial (un "override") para el servicio de Ollama:

sudo systemctl edit ollama.service

2. Añadir las variables de entorno

Se abrirá un editor de texto (probablemente Nano). Debes escribir exactamente lo siguiente entre las líneas de comentario (o al principio del archivo):

[Service]
Environment="OLLAMA_HOST=0.0.0.0"
Environment="OLLAMA_ORIGINS=*"

  • OLLAMA_HOST=0.0.0.0: Le dice a Ollama que escuche en todas las interfaces de red, no solo en localhost.
  • OLLAMA_ORIGINS=*: Elimina las restricciones de CORS para que AnythingLLM pueda hacer peticiones al servidor.

3. Guardar y Salir

  • Si usas Nano: Presiona Ctrl + O para guardar, luego Enter, y finalmente Ctrl + X para salir.

4. Recargar y Reiniciar el servicio

Para que los cambios surtan efecto, debes decirle a Linux que recargue las configuraciones y reinicie Ollama:

sudo systemctl daemon-reload
sudo systemctl restart ollama

5. Verificación final

Para asegurarte de que las variables se aplicaron correctamente, puedes ejecutar:

systemctl show ollama.service | grep Environment

Deberías ver una línea que incluya OLLAMA_HOST=0.0.0.0 y OLLAMA_ORIGINS=*.

Nota de seguridad: Al configurar OLLAMA_ORIGINS=* y 0.0.0.0, cualquier persona en tu red local podría acceder a tu servidor de Ollama. Si estás en una red pública, ten cuidado. En redes domésticas privadas, esto es lo estándar para que Docker o dispositivos externos se conecten.

@obvius360 commented on GitHub (Jan 18, 2026): > ### How are you running AnythingLLM? > > Docker (local) > ### What happened? > > I installed the docker version of AnythingLLM: > > 1. installed docker, yarn and node alongside > > 2. docker pull mintplexlabs/anythingllm > > > -> The docker version is running on (http://localhost:3001) > > I installed the docker version of Ollama and it is running on (http://localhost:11434/) > ### Are there known steps to reproduce? > > 1. Create a new workspace > > 2. Set Ollama as the Workspace LLM Provider > > 3. Write some queries in the thread > => Your Ollama instance could not be reached or is not responding. Please make sure it is running the API server and your connection information is correct in AnythingLLM. > > > I tested different ways written in documentations; set the fix IP for Ollama or install it on docker. **For me: Only this works:** Para configurar las variables de entorno de Ollama en Linux (cuando se usa el instalador estándar que crea un servicio de `systemd`), debes seguir estos pasos técnicos: ### 1. Editar el servicio de Ollama Abre una terminal y ejecuta el siguiente comando. Esto abrirá un archivo de configuración especial (un "override") para el servicio de Ollama: ```bash sudo systemctl edit ollama.service ``` ### 2. Añadir las variables de entorno Se abrirá un editor de texto (probablemente Nano). Debes escribir exactamente lo siguiente entre las líneas de comentario (o al principio del archivo): ```ini [Service] Environment="OLLAMA_HOST=0.0.0.0" Environment="OLLAMA_ORIGINS=*" ``` * **OLLAMA_HOST=0.0.0.0**: Le dice a Ollama que escuche en todas las interfaces de red, no solo en localhost. * **OLLAMA_ORIGINS=***: Elimina las restricciones de CORS para que AnythingLLM pueda hacer peticiones al servidor. ### 3. Guardar y Salir * Si usas **Nano**: Presiona `Ctrl + O` para guardar, luego `Enter`, y finalmente `Ctrl + X` para salir. ### 4. Recargar y Reiniciar el servicio Para que los cambios surtan efecto, debes decirle a Linux que recargue las configuraciones y reinicie Ollama: ```bash sudo systemctl daemon-reload sudo systemctl restart ollama ``` ### 5. Verificación final Para asegurarte de que las variables se aplicaron correctamente, puedes ejecutar: ```bash systemctl show ollama.service | grep Environment ``` Deberías ver una línea que incluya `OLLAMA_HOST=0.0.0.0` y `OLLAMA_ORIGINS=*`. **Nota de seguridad:** Al configurar `OLLAMA_ORIGINS=*` y `0.0.0.0`, cualquier persona en tu red local podría acceder a tu servidor de Ollama. Si estás en una red pública, ten cuidado. En redes domésticas privadas, esto es lo estándar para que Docker o dispositivos externos se conecten.
yindo changed title from [BUG]: Unable loading Ollama with dokcer Anythingllm (Ollama instance could not be reached or is not responding) to [GH-ISSUE #3436] [BUG]: Unable loading Ollama with dokcer Anythingllm (Ollama instance could not be reached or is not responding) 2026-06-05 14:45:14 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2216