web-ui: [Errno 111] Connection refused

On Macbook M1, running via Docker.

I made the adjustment to the dockerfile as describe here: https://github.com/browser-use/web-ui/issues/100

But when I run the agent, I receive [Errno 111] Connection refused

How to debug/resolve this issue?

Thanks?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 24 (2 by maintainers)

Most upvoted comments

If you’re working with Ollama, you should update the OLLAMA_ENDPOINT to “http://host.docker.internal:11434” in your .env file. This allows the Docker container to communicate with the Ollama application running on your host machine, as “localhost” inside a container refers to the container itself, not your computer.

also I made pr about this issue : https://github.com/browser-use/web-ui/pull/399

I have ollama running in a docker container and I was getting this same error.

I was able to get this working by adding:

    extra_hosts:
      - "host.docker.internal:host-gateway"

To the docker-compose file.

Then, in my .env file, I set the Ollama endpoint like this:

OLLAMA_ENDPOINT=http://host.docker.internal:11434

For troubleshooting you can use: docker exec -it web-ui-browser-use-webui-1 bash

Then try: curl http://host.docker.internal:11434

If you get a “curl: (6) Could not resolve host: host.docker.internal” message then the web-ui container is unable to talk to the ollama container so you’ll have to dig a bit more.

as i understood problem localhost url will not work because it is looking into container itself so only solution is run ollama as docker container docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama and then run model docker exec -it ollama ollama run qwen2.5:7b and then use base url http://yourhostname:11434 now i dont have issue but it is very slow for local model it taken task (go to google.com and type ‘OpenAI’ click search) for me to complete around 15 minute when we use locally deepseek and qwen model so better use google gemini gemini-2.0-flash-exp model with free api which can complete in 1 minute only

I had same Errno111 while running the browser-use/webui via docker on M4 mac

changed the .env files OLLAMA_ENDPOINT to below and worked for me

//.env #OLLAMA_ENDPOINT=http://localhost:11434 OLLAMA_ENDPOINT=http://host.docker.internal:11434 # changed to docker internal host //

Additional point that I also changed the docker-compose.yml file becoz it didn’t detect the mac silicon somehow while build the docker image, so forced to use arm64 platform configuration

//docker-compose.yml browser-use-webui: platform: linux/arm64 # changed to arm64 from amd64 build: context: . dockerfile: ${DOCKERFILE:-Dockerfile} args: TARGETPLATFORM: ${TARGETPLATFORM:-linux/arm64} # changed to arm64 from amd64 //

I got the exact same m1 16gb ram

i have the same issue but on Windows by only following the Docker installation