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
| Field | Description |
|---|---|
baseUrl | Base URL of your SearXNG instance (required) |
categories | Comma-separated categories like general, news, or science |
language | Language 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=jsonendpoint, not HTML scraping - Image result URLs -- results in the image category include
img_srcwhen SearXNG provides a direct image URL - No API key -- works with any SearXNG instance immediately
- Base URL validation --
baseUrlmust be a validhttp://orhttps://URL - Network guard --
http://base URLs must point to a trusted private or loopback host (public hosts requirehttps://);https://base URLs that resolve to a private or internal address receive the same self-hosted allowance, whilehttps://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 explicitproviderselection - Self-hosted -- you control the instance, queries, and upstream search engines
- Categories default to
generalwhen not set - Category fallback -- if a request for a non-
generalcategory succeeds but yields zero results, OpenClaw retries the same query once withgeneralbefore 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
jsonformat enabled in itssettings.ymlundersearch.formats.
Related
- Web Search overview -- all providers and auto-detection
- DuckDuckGo Search -- another key-free provider
- Brave Search -- structured results with free tier