How to Self-Host a Search Engine with SearXNG
Why this matters
Every search you run hands a company a list of the things you are looking for. That list is more revealing than most people expect: one medical question at 2am says something entirely different from one shopping query.
SearXNG is a metasearch engine. It takes your query, sends it to dozens of upstream engines from its own server, and returns the combined results as one page. The engines see the server’s address. You see a page with no trackers on it, no profile being built, and no cookie in sight.
It is also the rare self-hosted service that earns its keep on the first day. There is no setup to speak of — one container, one file — and the difference between searching through it and searching through Google is immediate.
What I tested on
- OS: OpenCloudOS 9.6 (kernel 6.6.119-49.23.oc9.x86_64)
- SearXNG: 2026.10.29
- Runtime: Docker 29.9.2 with Compose v5.6.1
- Hardware: 2 vCPU / 3.5 GB RAM / 60 GB xfs
- Duration: set up in October 2026, and the timings below are from that instance

How I tested
I ran real queries against the instance and timed them, rather than checking that the page loaded. The 47-result count and the 1.2-second timing in the screenshot come from a homelab docker compose query against the container described below. I also turned the container’s own log off and on again to see which errors were mine to fix.
Step 1: The compose file
services:
searxng:
image: searxng/searxng:latest
container_name: searxng
restart: unless-stopped
ports:
- "127.0.0.1:8080:8080"
environment:
- SEARXNG_BASE_URL=https://searx.example.com/
volumes:
- ./searxng:/etc/searxng:rw
The 127.0.0.1 binding matters. SearXNG has no authentication at all — anyone who can reach the port can use it, and a public instance on a cloud IP gets scraped within hours. Binding to the loopback and letting the reverse proxy in front handle the outside world is the only sane arrangement.
Step 2: The settings that matter
SearXNG ships with a large default configuration, and almost all of it is fine. Two things are worth changing.
# ./searxng/settings.yml
use_default_settings: true
server:
port: 8080
bind_address: "0.0.0.0"
secret_key: "a-long-random-string"
limiter: false
image_proxy: false
search:
safe_search: 0
default_lang: "en"
outgoing:
request_timeout: 3.0
max_request_timeout: 10.0
secret_key is not optional. SearXNG signs the cookies it uses to remember your preferences, and without a real key every user shares one session. The default value in the shipped file is a placeholder.
limiter: false is the decision worth arguing about. The limiter exists to stop people using your instance as a free search API. It needs Redis alongside it, it needs a bot-detection configuration file, and if the X-Forwarded-For header is missing it logs a warning on every request and blocks legitimate traffic. On a private instance behind a reverse proxy that already rate limits, it is more trouble than it is worth. On a public one, leave it on.

Step 3: Bring it up
docker compose up -d
docker compose ps
curl -s -o /dev/null -w "status=%{http_code} time=%{time_total}s\n" \
"http://127.0.0.1:8080/search?q=homelab+docker+compose"
That last command is the one to keep. It answers with the same status and timing a browser would see, which makes it easy to put behind a health check instead of discovering at 9am that the container died overnight.
Step 4: Put a reverse proxy in front
SearXNG does not terminate TLS. Whatever sits in front of it has to:
server {
server_name searx.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
The X-Forwarded-For and X-Real-IP headers are not optional decoration. SearXNG reads them to work out the client’s address, and without them every request in the log is attributed to the proxy, which is how you end up unable to tell a scraper from a reader.
If you use the Caddy walkthrough, the equivalent is three lines and Caddy handles the rest.
The three problems you will hit
Engines block cloud addresses. This is the big one and it is not fixable in configuration. Google, Bing and several others rate-limit or refuse requests from datacenter IP ranges, so a SearXNG instance on a VPS returns fewer results than the same instance at home. The engines that still work are the ones nobody guards, which are not the ones you most wanted. Nothing about SearXNG is wrong here — the upstream is telling the difference between a home connection and a datacentre one, which is exactly the fingerprinting it exists to avoid.
Some engines fail to load entirely. The container log for this instance shows one engine refusing to start:
ERROR:searx.engines: (PID 621) torch: can't register engine (loading engine failed)
An engine that cannot load is skipped, not fatal. You lose that source and the rest keep working. If a particular engine matters, check the log after the first start rather than assuming it is contributing.
Timing is not Google’s timing. A metasearch engine waits for the slowest engine it queried, not the fastest. One to two seconds is normal, and the tail is much worse than the median — a query where one upstream hangs will sit until max_request_timeout expires. Lower it if you would rather have a fast partial answer than a complete slow one.
Pros and cons
Pros:
- The upstream engines never see your address
- No cookie, no profile, no history that outlives the session
- One container and one YAML file
- The JSON API makes it scriptable, if you are willing to configure the format list
Cons:
- Slower than any single engine, by design
- Cloud IP ranges get throttled, so results are thinner than they should be
- No authentication — it must not be exposed directly
- Upstream changes break engines quietly
Best for / Skip if
Best for: people who already have a server and want one more thing that does not involve a company. The marginal cost is about 180 MB of memory and a minute of setup.
Skip if: you need complete, fast, reliable results. A metasearch engine is a privacy trade, not a speed trade, and the trade is worse from a datacentre than from a home connection.
Alternatives
- Whoogle — Google results only, one query instead of many, and the same privacy story with far less to go wrong
- LibreX — the same idea, with an instance directory so you can find other people’s
- SearXNG on a residential connection — if you can put it at home rather than in a datacentre, the engine-blocking problem largely goes away
- Searching your own archive instead — if what you keep is pages you saved, Linkding keeps the text of a bookmarked page and searches it locally, with no upstream engines involved
Verdict
SearXNG is the best self-hosted privacy tool most people have never heard of, and it is worth running even if you only use it occasionally. The cloud-IP problem is real, but it is a reason to run it at home if you can, not a reason not to run it.
References
- SearXNG documentation — settings and the admin API
- SearXNG admin guide — engine configuration and the limiter
FAQ
Why not just use DuckDuckGo?
Because even DuckDuckGo sends the query to third parties. SearXNG makes the request from your own server.
Can I use it on mobile?
Yes. Point the browser's search URL at it and every query on the phone goes through your server.
Is it as fast as Google?
No. It fans out to many engines at once and waits for all of them, so expect one to two seconds rather than a few hundred milliseconds.