Can't connected to self hosted Ollama ECONNREFUSED

Since other question about same issue is closed and locked and I can’t reply to it, I decided to create a new question with the answer below

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

For me, it didnt feel right to run ollama through docker as the only solution so I looked around till I find this answer nginx - From inside of a Docker container, how do I connect to the localhost of the machine? - Stack Overflow

To my surprise, adding ollama credentials in n8n with this url worked:
http://docker.for.mac.localhost:11434/

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.