SearXNG Search Integration: Self-Hosted Meta-Search for OpenClaw

Learn how to integrate SearXNG as a self-hosted, key-free web search provider in OpenClaw. This guide covers setup, configuration, and environment variables for developers seeking a private, cost-free search solution.

Read this when

  • You want a self-hosted web search provider
  • You want to use SearXNG for web_search
  • You need a privacy-focused or air-gapped search option

OpenClaw integrates with SearXNG as a self-hosted, key-free web_search search provider. SearXNG is an open-source meta-search engine that pulls results from Google, Bing, DuckDuckGo, and other sources.

Benefits:

  • No cost and no limits -- no API key or paid subscription needed
  • Privacy and air-gap -- queries remain inside your own network
  • Universal access -- no geographical limitations on commercial search APIs

Setup

Install the plugin

openclaw plugins install @openclaw/searxng-plugin

Run a SearXNG instance

docker run -d -p 8888:8080 searxng/searxng

You can also point to any existing SearXNG instance you already have. For production deployment, refer to the SearXNG documentation.

Configure

openclaw configure --section web
# Select "searxng" as the provider

Alternatively, set the environment variable and let auto-detection locate it:

export SEARXNG_BASE_URL="http://localhost:8888"

Config

{
  tools: {
    web: {
      search: {
        provider: "searxng",
      },
    },
  },
}

Plugin-level configuration for the SearXNG instance:

{
  plugins: {
    entries: {
      searxng: {
        config: {
          webSearch: {
            baseUrl: "http://localhost:8888",
            categories: "general,news", // optional
            language: "en", // optional
          },
        },
      },
    },
  },
}

baseUrl also supports a SecretRef object, such as { source: "env", id: "SEARXNG_BASE_URL" }.

Environment variable

Use SEARXNG_BASE_URL instead of a config setting:

export SEARXNG_BASE_URL="http://localhost:8888"

Resolution order: the configured baseUrl string, then an inline env SecretRef on baseUrl, then SEARXNG_BASE_URL. If none of these config paths are set and SEARXNG_BASE_URL is present without an explicit provider selection, auto-detection defaults to SearXNG.

Plugin config reference

FieldDescription
baseUrlBase URL of your SearXNG instance (required)
categoriesComma-separated categories like general, news, or science
languageLanguage code for results, for example en, de, or fr

The web_search tool call also accepts count (1 to 10 results), categories, and language as per-call overrides.

Notes

  • JSON API -- uses SearXNG's native format=json endpoint, not HTML scraping
  • Image result URLs -- results in the image category include img_src when SearXNG provides a direct image URL
  • No API key -- works with any SearXNG instance immediately
  • Base URL validation -- baseUrl must be a valid http:// or https:// URL
  • Network guard -- http:// base URLs must point to a trusted private or loopback host (public hosts require https://); https:// base URLs that resolve to a private or internal address receive the same self-hosted allowance, while https:// base URLs that resolve publicly maintain strict SSRF protection
  • Auto-detection order -- SearXNG requires a configured baseUrl (order 200 among providers that already have their required credential). Key-free providers like DuckDuckGo or Ollama Web Search never win auto-detection implicitly; they only activate on an explicit provider selection
  • Self-hosted -- you control the instance, queries, and upstream search engines
  • Categories default to general when not set
  • Category fallback -- if a request for a non-general category succeeds but yields zero results, OpenClaw retries the same query once with general before returning an empty result set
  • Result caching -- identical queries (same query, count, categories, language, and base URL) are cached in-process for a short TTL
  • Version requirement -- the plugin declares minHostVersion: >=2026.6.9

Tip

For the SearXNG JSON API to function, ensure your SearXNG instance has the json format enabled in its settings.yml under search.formats.

596 words · updated Jul 27, 2026