Self-hosted web search for OpenClaw agents using a local SearXNG instance.
This plugin exposes a web_search tool backed by SearXNG running on your own machine. It avoids third-party search API keys and keeps the search stack local.
- An OpenClaw plugin that registers a
web_searchtool - A Docker setup for running SearXNG on
127.0.0.1:8080 - A bundled SearXNG config tuned for this plugin
- Docker and Docker Compose
- Node.js 20+ and npm
- OpenClaw with plugin loading enabled
Agent -> web_search -> OpenClaw plugin -> SearXNG (localhost:8080) -> search engines
Start the bundled SearXNG container with this script:
./start.shThe script runs npm run build from the repo root to build the plugin, then docker compose up -d from docker/docker-compose.yml.
Check that it is healthy:
curl http://localhost:8080/healthzor open:
http://localhost:8080- docker/docker-compose.yml
Runs the SearXNG container and binds it to
127.0.0.1:8080 - docker/settings.yml Defines the SearXNG instance settings and enabled engines
Start:
cd docker
docker compose up -dStop:
cd docker
docker compose downRestart after changing settings.yml:
cd docker
docker compose restart searxngView logs:
cd docker
docker compose logs -f searxngIf you want OpenClaw to use this plugin for search, disable the built-in web search and fetch tools in your openclaw.json:
{
"tools": {
"profile": "coding",
"web": {
"search": {
"enabled": false
},
"fetch": {
"enabled": false
}
}
}
}This matters because otherwise OpenClaw may continue using its own built-in web tools instead of this plugin.
Add this repo to your OpenClaw json openclaw.json and enable the plugin entry.
Example config:
{
"plugins": {
"load": {
"paths": ["/path/to/this-cloned-repo"]
},
"entries": {
"searxng-search": {
"enabled": true,
"config": {
"searxngUrl": "http://localhost:8080",
"engines": ["duckduckgo", "brave", "grokipedia", "wikipedia", "github"],
"timeout": 10000
}
}
}
}
}If your OpenClaw config is on Windows, use the local absolute path to this repo.
After updating config and building the plugin:
openclaw gateway restartAt that point, the web_search tool should be available through this plugin.
Edit docker/settings.yml to change enabled engines or instance behavior.
Bundled defaults:
- Bind address:
0.0.0.0inside the container - Host port:
127.0.0.1:8080 - Default language:
en-US - Request timeout:
5s - Enabled core engines: DuckDuckGo, Brave, Grokipedia, Wikipedia, GitHub
After changes:
cd docker
docker compose restart searxngCheck all of the following:
- Built-in OpenClaw web tools are disabled in
openclaw.json - The plugin is built with
npm run build - The plugin path is correct in OpenClaw config
- The plugin entry
searxng-searchis enabled
The plugin defaults to:
http://localhost:8080
Make sure the container is running:
cd docker
docker compose psThen check:
curl http://localhost:8080/healthz- Review the enabled engines in docker/settings.yml
- Check SearXNG logs with
docker compose logs -f searxng - Restart the container after config changes
Install dependencies:
npm installBuild:
npm run buildWatch mode:
npm run dev