SearXNG Search

Self-hosted, privacy-respecting web search via Docker

TL;DR Run cd searxng && start.bat to start the search engine, then use /searxng on from the CLI.

Overview

SearXNG is a free, privacy-respecting metasearch engine. This project provides a Docker-based setup so you can run your own instance locally, avoiding reliance on public instances (which increasingly return 403/429 due to Cloudflare/anti-bot protection).

Quick Start

cd searxng
start.bat

Starts SearXNG on http://localhost:18889.

Slash Command

CommandAction
/searxng onStart the Docker container
/searxng offStop the Docker container
/searxng statusCheck if running
/searxng restartRestart the container

Manual Docker Commands

docker compose -f searxng/docker-compose.yml up -d
docker compose -f searxng/docker-compose.yml down
docker compose -f searxng/docker-compose.yml logs -f

Files

FilePurpose
searxng/docker-compose.ymlContainer definition, port 188899 8080
searxng/.envHost, port, and secret key
searxng/config/settings.ymlSearXNG configuration with JSON API enabled
searxng/limiter.tomlRate limiter — relaxed for local network IPs
searxng/start.batStart wrapper
searxng/stop.batStop wrapper
searxng/restart.batRestart wrapper
searxng/logs.batLog tail wrapper

How It Works

  1. SearXNG runs in Docker on localhost:18889
  2. The project's .env sets SEARXNG_INSTANCE_URL=http://localhost:18889
  3. selectBestDirectProvider() in WebSearchTool.ts auto-detects this and prioritises SearXNG
  4. The SearXNGProvider sends GET requests with format=json and parses results

Engines Enabled

  • DuckDuckGo — primary general search (no API key needed)
  • Google — general search
  • Wikipedia — infobox and article results
  • StackOverflow — technical Q&A
  • GitHub — repository search
  • Wikidata — structured data infoboxes

Provider Selection Priority

  1. Tavily — requires TAVILY_API_KEY
  2. Brave — requires BRAVE_API_KEY
  3. Serper — requires SERPER_API_KEY
  4. SearXNG — only if SEARXNG_INSTANCE_URL is explicitly set
  5. DuckDuckGo — always available, free, no API key

Troubleshooting

Container won't start

docker compose -f searxng/docker-compose.yml logs

No results returned

Check that engines are not failing by visiting http://localhost:18889 and performing a search in the web UI.

Port conflict

Change SEARXNG_PORT in searxng/.env and update SEARXNG_INSTANCE_URL in .env to match.

Updating

cd searxng
docker compose pull
docker compose up -d