Hello my local-hosted n8n instance can’t connect to ollama in different docker container. I tried almost everything but n8n still can’t connect. So right now I here with this error:
I’m using stock ollama and n8n containers.
Additional info:
Windows 11
Docker Desktop with WSL
n8n version: 1.107.3
Answer
First you need to run this command
docker inspect (ollama container id)
Then find “IPAddress” and paste it into “Base URL” in n8n
Hey @buldrew hope all is good. Welcome to the community.
Could you please share the output of
docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Networks}}\t{{.Status}}"
CONTAINER ID NAMES NETWORKS STATUS
b2585d33b28c nextcloud-aio-mastercontainer bridge Exited (0) 2 hours ago
b03a04cc0002 ollama bridge Up 5 hours
25bdab11c6c4 n8n bridge Up 5 hours
Thank you.
Containers on the default bridge network can only access each other by IP addresses. I suggest you create a custom network and make both containers join that network. This will allow them to reference each other by names.
Thank you anyway for trying to help me. I found an answer. I’ll update my post with it
The ip address may change between container reboots. Just thought you would want to know.
1 Like