Skip to main content

Posts

Showing posts with the label Docker Compose

Solved: 'dial tcp 127.0.0.1:11434: connect: connection refused' in Ollama

  You have successfully installed Ollama. You can verify it works by running   ollama run llama3   in your terminal. You then spin up a UI like Open WebUI or a custom Docker container to interact with your models, but the connection fails immediately. The logs display a fatal networking error:  dial tcp 127.0.0.1:11434: connect: connection refused . This guide resolves this specific networking blockage. It addresses the root cause of Docker interface isolation and Ollama's default binding security policies. The Root Cause: Loopback Isolation To fix this, you must understand why  localhost  is failing. When you run a command inside a Docker container,  localhost  (or  127.0.0.1 ) refers to the  container itself , not your host machine (your laptop or server). If Ollama is running on your host OS (Mac, Windows, or Linux) and your application is running inside a Docker container, the application is trying to find Ollama  inside  t...