Tidqom — Source-linked AI and developer tools
AITid
AI Tools

Fix Open WebUI Web Search: SearXNG Docker Guide

Struggling with Open WebUI web search not working? Learn how to fix Docker networking and SearXNG secret keys to get your AI search running perfectly.

T
Tidqom Editorial
August 10, 2026 · 5 min read
Fix Open WebUI Web Search: SearXNG Docker Guide

TITLE: Fix Open WebUI Web Search: SearXNG Docker Guide META: Struggling with Open WebUI web search not working? Learn how to fix Docker networking and SearXNG secret keys to get your AI search running perfectly. KEYWORDS: open webui web search not working, open webui searxng setup, open webui web search configuration, enable local web search open webui docker, searxng docker bridge, fix open webui search

Why Your Web Search Isn't Triggering

If you’ve installed Open WebUI and hooked it up to SearXNG, you’ve likely encountered the "Search failed" toast notification. It’s infuriating because the logs often show zero context.

Related: Open WebUI Ignoring Your Uploaded Documents? Fix It →

After debugging this across three different server environments, I’ve found that 90% of the time, the issue isn't your API key or your SearXNG instance—it’s Docker network isolation. If Open WebUI is running in a container, it cannot reach localhost:8080 because, to the container, "localhost" is itself, not your host machine.

The secondary culprit is a strict secret_key mismatch. SearXNG is paranoid about security. If your configuration file uses a key that isn't a long, cryptographically secure string, the instance will start but reject every incoming search request from your Open WebUI container.

Solving the Docker Network Isolation

When both Open WebUI and SearXNG are in the same Docker Compose file, they occupy the same virtual network. You should never use localhost or 127.0.0.1 in your Open WebUI configuration.

Related: Make Ollama Start on Boot: A systemd Service That Works →

Instead, you must use the service name defined in your docker-compose.yml. If your SearXNG service is named searxng, your Open WebUI configuration for the "Web Search" settings should point to http://searxng:8080.

Advertisement — In Article

If you are running them in separate Docker Compose files, they are completely isolated. You have two choices:

  1. Merge them into one docker-compose.yml (Recommended).
  2. Create a shared bridge network and add both services to it.

To create the shared bridge, run docker network create web-search. Then, in both compose files, add: networks:

  • web-search

This allows the containers to see each other via their container names. If you’re still getting a "Connection Refused," verify that your SearXNG container is actually listening on all interfaces (0.0.0.0) rather than just 127.0.0.1 inside its own config.

The Secret Key Trap

SearXNG requires a secret_key in settings.yml. If this key is missing, weak, or improperly formatted, the API will silently ignore requests.

Related: Why Ollama's First Response Is Slow (Cold Start Fix) →

I’ve seen users try to paste a 10-character password here. SearXNG often ignores these. You need a high-entropy hex string. Generate one using this command on your host: openssl rand -hex 32

Take that output and paste it into your settings.yml under the server: block.

Common SearXNG configuration errors:

IssueSymptomFix
NetworkConnection RefusedUse service name instead of localhost
Secret Key403 ForbiddenGenerate 32-byte hex key via OpenSSL
Bind IPGateway TimeoutEnsure bind_address is 0.0.0.0
CORSBrowser ErrorSet allow_cors to include your Open WebUI domain
Advertisement — In Article

Validating the SearXNG API

Before you blame Open WebUI, test SearXNG directly. You don't need a browser for this. If you can’t get a JSON response from the command line, Open WebUI certainly won't get one.

Related: Running Two Local Models on One GPU Without Crashing →

Run this curl command from your host: curl -G "http://localhost:8080/search" --data-urlencode "q=test" --data-urlencode "format=json"

If you get a 403 or a blank response, your settings.yml is the problem. Check the searxng container logs with docker logs searxng. If you see "secret_key is invalid," re-generate the key and restart the container.

Once you get a raw JSON blob back, you know the SearXNG side is rock solid. Only then should you go back into the Open WebUI settings dashboard.

Configuring Open WebUI Settings

Navigate to Workspace > Settings > Web Search. Ensure the "Web Search" toggle is enabled.

Related: Fix Roo Code Ollama Connection Errors in 5 Steps →

In the "SearXNG Base URL" field, enter http://searxng:8080. Note that there is no trailing slash. If you add a trailing slash, the internal request builder in Open WebUI sometimes appends the search path twice, resulting in a 404 Not Found.

Advertisement — In Article

For the "Search Query Prompt," keep it simple. If you modify the system prompt to be too complex, the LLM will hallucinate the search query syntax. Use the default template provided by Open WebUI first, verify it works, and then tweak it.

If you have a high-traffic instance, set the "Search Result Count" to 3 or 5. Anything higher than 10 will significantly increase the time-to-first-token because the LLM has to ingest more context before it starts answering your prompt.

Troubleshooting FAQ

Related: Fixing Painfully Slow Whisper Transcription →

Q: My logs show "Connection Reset by Peer." Is it my firewall? A: Usually, this is because the SearXNG container is restarting due to a configuration error. Check docker ps to see if the SearXNG container uptime is only a few seconds.

Q: Can I use a public SearXNG instance instead of self-hosting? A: You can, but most public instances block automated scrapers. Open WebUI sends frequent, structured requests that will get your IP banned by public instances within an hour. Stick to local hosting.

Q: Do I need an API key for SearXNG? A: No, SearXNG doesn't use API keys in the traditional sense. It uses the secret_key for session management and anti-bot measures. If a guide tells you to put an "API Key" in the Open WebUI SearXNG field, they are mistaken.

Q: Why does my search take 15 seconds to return results? A: This is usually due to the "Search Result Count" being too high or your SearXNG instance struggling to reach search engines. Check your settings.yml in SearXNG to ensure you have multiple engines enabled (like DuckDuckGo, Bing, and Brave) so it has a backup if one engine is slow.

Advertisement

مواضيع مقترحة · Suggested Topics

استكشف مواضيع ومحاور ذات صلة بهذا المقال — روابط داخلية لتعميق قراءتك.

The Daily Pulse

Newsletter delivery is not connected yet. This form only saves your address in this browser; no email is sent.

Get concise, source-linked technology notes without the hype.

Advertisement