SearXNG

Pi-hole cleaned up the rest of my network a while ago, and the last big tracker standing in my daily life was the search box, because every query I type is a confession, health worries and purchases I am considering and the name of a rash and the salary of a job I was curious about, and all of it goes to a company whose business model is selling certainty about what people want. The results page itself got worse alongside the tracking, a third of the screen is ads and another third is SEO spam engineered to rank rather than inform, and the private alternatives all had the same shape, a different company promising to hold my confessions instead.

SearXNG breaks the shape, an open-source metasearch engine, thirty-six thousand stars, that you run yourself, and the trick is that it does not have its own index, because building an index is the impossible part of search. Instead it takes your query and fires it at Google and Bing and DuckDuckGo and Brave and Qwant and dozens of specialized engines all at once, anonymously, with no cookies and your IP held back, merges the results, strips the ads, and hands you one clean page from your own domain, so the search engines see a query from my server and never learn which human wanted to know.

The daily difference is smaller than the philosophical one, which is the best kind of difference. Results come back in one column with no shopping carousel, the settings let you pick which engines and which categories feed each search, images and videos and maps and news all work as tabs, and the bang shortcuts carry over from DuckDuckGo, so typing !w before a query searches Wikipedia directly and !yt goes to YouTube, which means the muscle memory from years of DDG transfers without retraining. I made it the default search engine in every browser I use, and after a week the old habit of mentally filtering the ads had quietly disappeared because there was nothing left to filter.

The compose file is the engine plus a cache it shares with it.

services:
  searxng:
    image: searxng/searxng:latest
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./searxng:/etc/searxng
    environment:
      SEARXNG_BASE_URL: https://search.yourdomain.com/
    depends_on:
      - valkey

  valkey:
    image: valkey/valkey:8-alpine
    restart: unless-stopped
    command: valkey-server --save 30 1 --loglevel warning
    volumes:
      - valkey-data:/data

volumes:
  valkey-data:

The searxng folder starts empty and the container generates a settings.yml into it on first boot, and that file is where the interesting decisions live, so let it generate once and then open it.

use_default_settings: true

server:
  secret_key: "generate-a-real-random-string"
  limiter: false

search:
  formats:
    - html
    - json

The generated file already contains a random secret key, the limiter exists to protect public instances from bots and rate abuse and needs Redis-backed tracking to run, so for a private instance behind Caddy where the only visitors are me and my family, switching it off is the correct move and saves a debugging spiral I went through so you do not have to. The json format is disabled by default and enabling it lets you use the search API from scripts and n8n flows, which is how my morning briefing query runs without a browser.

One honest warning about self-hosting search, the engines are not thrilled about metasearch, and if you hammer them or expose the instance publicly without a limiter, Google will start serving captchas to your server’s IP, which degrades every search until it cools down. A private instance with one user’s worth of traffic lives under that threshold comfortably, and if you ever want to share the instance, the limiter plus the valkey cache is exactly what they exist for.

The search box on my devices now points at a domain I pay for, the queries sit in a container I can inspect, and the results are better than what the ads left behind, which was the surprise, because I expected to trade quality for privacy and got both. The confession box is in my cupboard now, and it does not sell.

If what you search for is nobody’s business, subscribe to the newsletter.