SearXNG: Self-Host a Private Metasearch Engine for Your Homelab with Docker Compose
SearXNG is an AGPL-3.0 metasearch engine that queries Google, Bing, DuckDuckGo, Wikipedia, GitHub and many more on your behalf, without tracking or profiling you. Here is how to run it with the new official Docker Compose template, Valkey and a JSON API for your other self-hosted tools.
Over the last weeks a few tools on this blog quietly assumed you already had one thing running: a search backend you control. Firecrawl can use one for its search endpoint, AI front ends love one, and honestly, your own browser deserves one too. That backend is almost always SearXNG.
SearXNG is not new, but it is about as alive as an open-source project gets: there were new commits on the master branch this very morning, fresh container images land several times a day, and the project has recently moved its official Docker setup into the main repository. Time for a proper deep dive.
What is SearXNG?
SearXNG is a metasearch engine. It does not crawl the web itself. Instead, when you search, it sends your query to many search services at once (Google, Bing, DuckDuckGo, Brave, Wikipedia, GitHub, Stack Overflow, Docker Hub and so on), merges and ranks the results and shows them on one page. The upstream engines see a request from your SearXNG server, not from you, and SearXNG itself does not track or profile users. Your preferences are stored in a browser cookie, not in a server-side account.
It started in 2021 as a fork of the older searx project. The facts, checked against the repository and docs today:
- License: GNU Affero General Public License v3.0 (AGPL-3.0-or-later).
- Release model: rolling release from
master. There is no classic changelog; the version is the date plus the commit hash. The newest container tag on Docker Hub when I wrote this was2026.11.29-254cb8159, and my local build from this morning's source reported itself as2026.11.30+ac80ddb. - Image:
docker.io/searxng/searxng, mirrored atghcr.io/searxng/searxng(handy if Docker Hub rate-limits you). - Port: the container listens on 8080, served by the Granian application server.
- Volumes:
/etc/searxngfor configuration (settings.ymland friends) and/var/cache/searxngfor persistent data such as the favicon cache.

Key features
Lots of engines, sorted into categories. The repository ships more than 250 engine modules. Results are grouped into tabs such as General, Images, Videos, News, Map, Music, IT, Science, Files and Social Media, and every result shows which engine(s) delivered it.
Search syntax for power users. Prefix ! picks an engine or category (!wp homelab, !images raspberry pi, !map Berlin), : picks a language (:de), and !! forwards to an external DuckDuckGo-style bang. Note that !! sends you straight to the external site, so SearXNG cannot protect your privacy there.
Plugins. Enabled by default are, among others, a calculator, a unit converter, hash generation (sha256 something), a tracker URL remover and the hostnames plugin. The latter lets you rewrite, remove or re-rank results by domain, for example rewriting YouTube links to your own front end, or pushing Wikipedia up and a content farm down.
Per-user preferences without accounts. Default categories, language, autocomplete provider, SafeSearch, theme and enabled engines are all set in the browser and saved in a cookie.

A real API. Add json (and optionally csv or rss) to the allowed output formats and every search is available as /search?q=...&format=json. That is what tools like Firecrawl or self-hosted AI chat front ends plug into. Without that setting, such requests get a 403 Forbidden, which is the number one support question.
Bot protection. The optional limiter rate-limits suspicious clients and does header and IP checks, so that bots hammering your instance do not get your server's IP blocked or CAPTCHA'd by Google and friends. It needs a Valkey database, which the official compose file already includes.
Engine statistics. /stats shows response times, result counts and reliability per engine, which is very useful to spot an engine that is currently being blocked.

Why self-host it?
Public instances exist (searx.space lists around 90 of them), and they are a great way to try SearXNG. But your own instance gives you a few things a public one cannot:
- You control the logs. On a public instance you trust a stranger.
- You can enable the JSON API, which most public instances disable.
- You choose the engines, weights and hostname rules, and can add your own (there are engines for Elasticsearch, Meilisearch, SQL databases and more for searching your own data).
- One search box for all your devices, set as the default search engine via the built-in OpenSearch description.
Installing SearXNG with Docker Compose
The old separate searxng-docker repository is no longer the recommended path. The official template now lives in the main repo under container/ and starts two services: core (SearXNG) and valkey.
1. Create the folder and fetch the templates
mkdir -p ./searxng/core-config/
cd ./searxng/
curl -fsSL \
-O https://raw.githubusercontent.com/searxng/searxng/master/container/docker-compose.yml \
-O https://raw.githubusercontent.com/searxng/searxng/master/container/.env.example
cp -i .env.example .env
For reference, the downloaded docker-compose.yml looks like this today:
name: searxng
services:
core:
container_name: searxng-core
image: docker.io/searxng/searxng:${SEARXNG_VERSION:-latest}
restart: always
ports:
- ${SEARXNG_HOST:+${SEARXNG_HOST}:}${SEARXNG_PORT:-8080}:${SEARXNG_PORT:-8080}
env_file: ./.env
volumes:
- ./core-config/:/etc/searxng/:Z
- core-data:/var/cache/searxng/
valkey:
container_name: searxng-valkey
image: docker.io/valkey/valkey:9-alpine
command: valkey-server --save 300 1 --save 60 1000 --loglevel warning
restart: always
volumes:
- valkey-data:/data/
volumes:
core-data:
valkey-data:
2. Edit .env
The template only contains commented-out examples. Since the whole file is passed into the container, you can also set the SEARXNG_* settings overrides here. A sensible start for a private instance behind a reverse proxy:
# pin a tested tag instead of "latest" once you are happy
SEARXNG_VERSION=2026.11.29-254cb8159
# only listen on localhost, the reverse proxy does the rest
SEARXNG_HOST=127.0.0.1
SEARXNG_PORT=8080
# public URL of your instance
SEARXNG_BASE_URL=https://search.example.com/
# use the Valkey container from the compose file
SEARXNG_VALKEY_URL=valkey://valkey:6379/0
3. Start it
docker compose up -d
docker compose ps
docker compose logs -f core
On first start the entrypoint copies a settings.yml template into core-config/ and replaces the placeholder secret_key with a random value, so you do not ship the famous ultrasecretkey. Open http://127.0.0.1:8080 (or your proxied domain) and search away.
Configuration tips
All configuration lives in core-config/settings.yml. The generated file starts with use_default_settings: true, so you only write down what you want to change; everything else comes from the upstream defaults. Restart the core container after edits.
Enable the JSON API for your other tools:
use_default_settings: true
search:
formats:
- html
- json
server:
secret_key: "keep-the-generated-value"
image_proxy: true
Then test it with curl 'https://search.example.com/search?q=searxng&format=json'.
Turn on the limiter if the instance is reachable from the internet: set limiter: true under server: (or SEARXNG_LIMITER=true) and make sure the Valkey URL is set. The limiter determines the client IP from X-Forwarded-For/X-Real-IP, so your reverse proxy must set these headers, and its address has to be listed in trusted_proxies in core-config/limiter.toml; by default only localhost is trusted. Get this wrong and either everyone looks like the same client, or nobody is limited. public_instance: true additionally enables the link-token bot check and the image proxy and is meant for truly public instances.
Keep it private. For a homelab, the simplest secure option is to not expose SearXNG publicly at all and reach it via VPN, or put it behind an authenticating proxy such as Pangolin or an SSO provider like Pocket ID. Keep in mind that browsers' search integration and API clients need to get through, too.
Trim the engine list. Disable engines you never use in the preferences or in settings.yml. Fewer engines means faster result pages and fewer upstream requests that could trigger rate limits.
Monitor it. SearXNG has a /healthz endpoint that returns 200, which is perfect for an HTTP check in Uptime Kuma. Watch /stats occasionally for engines whose reliability drops to zero.
Updating: docker compose pull && docker compose up -d. Every now and then, re-download the compose and .env.example templates and compare them with yours, as the docs recommend.
Coming from searxng-docker? Move your old searxng/* files into core-config/ and change the Valkey hostname in settings.yml to valkey (or searxng-valkey). The Caddy service of the old setup is gone; bring your own reverse proxy.
Limitations to know about
- It depends on other people's search engines. Google, Bing, DuckDuckGo and others do not love automated traffic. Engines get blocked, rate-limited or broken by HTML changes, sometimes for days. In my test from a datacenter IP, DuckDuckGo and Brave Images simply timed out or refused while Google (via its CSE engine), MDN, GitHub and Stack Overflow answered fine. The rolling release model is exactly what fixes these quickly, so update regularly.
- Privacy is relative. SearXNG hides you from the upstream engines, but they still see your server's IP and your search terms. On a single-user instance, those queries are effectively yours. For stronger anonymity you would have to route outgoing traffic through a proxy or Tor, which the outgoing settings support but which also slows things down.
- Result quality varies with the engine mix, and there is no personalised ranking. For some that is the point, for others a downside.
- No versioned releases. Pinning a date tag is fine, but there are no release notes to read before an update, only the commit history.
- AGPL-3.0: if you modify SearXNG and offer it to others over a network, you must provide your modified source code. For a private instance this does not matter.
How does it compare?
- Public SearXNG instances: zero maintenance, but you trust the operator and usually get no JSON API.
- Using Google, Bing or DuckDuckGo directly: better result quality per engine and no maintenance, but you search under their terms and tracking. SearXNG combines several of them behind your own IP.
- YaCy is a different idea: a peer-to-peer search engine with its own crawler and index. SearXNG crawls nothing and relies on existing engines, which makes it far lighter to run.
Conclusion
SearXNG is one of those homelab services that pays off every single day: a fast, ad-free search page for all your devices, a JSON search API for tools like Firecrawl, and full control over which engines get your queries. The new official compose template with Valkey makes setup a five-minute job. Pin a tag, enable json only if you need it, turn on the limiter before you expose it, and expect to update often, because the engines it relies on keep changing. More self-hosted building blocks are collected under the Self-Hosted tag.
Sources
- searxng/searxng on GitHub (README, LICENSE,
container/docker-compose.yml,container/.env.example,container/Dockerfile,container/entrypoint.sh,searx/settings.yml,searx/limiter.toml) - SearXNG docs: Installation container
- SearXNG docs: server settings and valkey settings
- SearXNG docs: Limiter
- SearXNG docs: Search API
- searxng/searxng on Docker Hub (tags)
- searx.space (public instance list)
- Screenshots: taken by uptime.bet from a local SearXNG instance built from the official source on 30 November 2026.