Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
AI and LLM integration

Open WebUI web search with SearXNG fails with 403

Error403 Client Error: Forbidden

Short answer

Open WebUI asks SearXNG for JSON results, and SearXNG refuses that unless json is listed in the formats in settings.yml. The log then shows 403 Client Error: Forbidden. Add json to the search formats, restart SearXNG, and use the container service name in the query URL, not localhost.

  • Applies to Open WebUI main image, SearXNG latest image, Docker Compose v2
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Read the Open WebUI log at the moment you run a search. A 403 points to the SearXNG settings; a connection error points to the URL.

    docker logs open-webui --tail 50
  2. 2Match what you see, then jump to its fix

    1. 1403 Client Error: Forbidden in the Open WebUI logjson is missing from the SearXNG formatsFix
    2. 2Connection errors instead of 403, or the setting saves but no results come backThe query URL points at the wrong hostFix

What does the error look like?

  • 403 Client Error: Forbidden
  • Web search returns no results with SearXNG selected

Cause 1 of 2

json is missing from the SearXNG formats

1Check

Open the SearXNG settings.yml and look at the formats list under search.

grep -n -A4 '^search:' searxng/settings.yml

2Fix

Add json to the formats list, then restart SearXNG. The Open WebUI guide says SearXNG blocks queries without it.

search:
  formats:
    - html
    - json

3Verify

Restart SearXNG, run a chat with web search on, and confirm the 403 line no longer appears.

docker compose restart searxng
docker logs open-webui --tail 30

Confirmed by docs.openwebui.com

Did this fix it?

Cause 2 of 2

The query URL points at the wrong host

1Check

If both services run in the same Compose project, the URL must use the SearXNG service name. localhost inside the Open WebUI container is Open WebUI itself.

docker exec open-webui env | grep -i searxng

2Fix

Set the query URL to the service name and the /search path, and select searxng as the engine.

environment:
  ENABLE_WEB_SEARCH: "true"
  WEB_SEARCH_ENGINE: "searxng"
  SEARXNG_QUERY_URL: "http://searxng:8080/search"

3Verify

Recreate the container and run a chat with web search switched on.

docker compose up -d open-webui && docker logs open-webui --tail 20

Confirmed by docs.openwebui.com

Did this fix it?

How do I stop it coming back?

  • Keep SearXNG settings.yml in a mounted file so your formats change survives container recreation.
  • Put Open WebUI and SearXNG in one Compose project and address them by service name.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

AI

Ollama is slow and the GPU is not being used

Replies arrive a few tokens per second on a machine with a GPU

Run ollama ps and read the PROCESSOR column: 100% GPU means the model is on the card, anything with CPU means it is not fully there.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.