> ## Content Index
> Fetch the complete content index at: https://blog.uptime.bet/llms.txt
> Use this file to discover other available public pages before exploring further.

# SearXNG: Self-Host a Private Metasearch Engine for Your Homelab with Docker Compose
- URL: https://blog.uptime.bet/searxng-self-hosted-private-metasearch-engine-docker/
- Published: 2026-11-30T08:00:00.000Z
- Updated: 2026-11-30T08:00:00.000Z
- Description: 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.
- Author: Alexandre Nebeling
- Tags: Trending, Self-Hosted, Open Source, Docker, Homelab, Privacy, Search, SearXNG

Over the last weeks a few tools on this blog quietly assumed you already had one thing running: a search backend you control. [Firecrawl](https://blog.uptime.bet/firecrawl-self-hosted-web-scraping-api-ai-docker/) 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](https://github.com/searxng/searxng?ref=blog.uptime.bet) 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 was `**2026.11.29-254cb8159**`, and my local build from this morning's source reported itself as `2026.11.30+ac80ddb`.
- **Image:** `docker.io/searxng/searxng`, mirrored at `ghcr.io/searxng/searxng` (handy if Docker Hub rate-limits you).
- **Port:** the container listens on **8080**, served by the Granian application server.
- **Volumes:** `/etc/searxng` for configuration (`settings.yml` and friends) and `/var/cache/searxng` for persistent data such as the favicon cache.

![SearXNG start page with the SearXNG logo, a single search field and links to About and Preferences in the top right corner](https://blog.uptime.bet/content/images/2026/11/searxng-searxng-home.webp)

The SearXNG start page: a search box, category tabs and nothing else. [Source: searxng/searxng (screenshot of a local instance)](https://github.com/searxng/searxng?ref=blog.uptime.bet) (AGPL-3.0)

## 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.

![SearXNG preferences page with tabs General, User Interface, Privacy, Engines, Special Queries and Cookies and options for default categories, search language, autocomplete, favicon resolver, DOI resolver and SafeSearch](https://blog.uptime.bet/content/images/2026/11/searxng-searxng-prefs.webp)

Preferences live in a cookie: categories, language, autocomplete, SafeSearch and more. [Source: searxng/searxng (screenshot of a local instance)](https://github.com/searxng/searxng?ref=blog.uptime.bet) (AGPL-3.0)

**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.

![SearXNG Engine stats table listing engines such as github, docker hub, stackoverflow, mdn and google cse with scores, result counts, response time bars and reliability percentages](https://blog.uptime.bet/content/images/2026/11/searxng-searxng-stats.webp)

The engine stats page shows at a glance which upstream engines answer, how fast and how reliably. [Source: searxng/searxng (screenshot of a local instance)](https://github.com/searxng/searxng?ref=blog.uptime.bet) (AGPL-3.0)

## 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**

```bash
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:

```yaml
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:

```bash
# 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**

```bash
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:

```yaml
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](https://blog.uptime.bet/pangolin-self-hosted-cloudflare-tunnel-alternative-docker/) or an SSO provider like [Pocket ID](https://blog.uptime.bet/pocket-id-self-hosted-passkey-sso-oidc-docker/). 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](https://blog.uptime.bet/uptime-kuma-2-self-hosted-uptime-monitoring-docker/). 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](https://blog.uptime.bet/tag/self-hosted/).

## Sources

- [searxng/searxng on GitHub](https://github.com/searxng/searxng?ref=blog.uptime.bet) (README, LICENSE, `container/docker-compose.yml`, `container/.env.example`, `container/Dockerfile`, `container/entrypoint.sh`, `searx/settings.yml`, `searx/limiter.toml`)
- [SearXNG docs: Installation container](https://docs.searxng.org/admin/installation-docker.html?ref=blog.uptime.bet)
- [SearXNG docs: server settings](https://docs.searxng.org/admin/settings/settings%5Fserver.html?ref=blog.uptime.bet) and [valkey settings](https://docs.searxng.org/admin/settings/settings%5Fvalkey.html?ref=blog.uptime.bet)
- [SearXNG docs: Limiter](https://docs.searxng.org/admin/searx.limiter.html?ref=blog.uptime.bet)
- [SearXNG docs: Search API](https://docs.searxng.org/dev/search%5Fapi.html?ref=blog.uptime.bet)
- [searxng/searxng on Docker Hub](https://hub.docker.com/r/searxng/searxng?ref=blog.uptime.bet) (tags)
- [searx.space](https://searx.space/?ref=blog.uptime.bet) (public instance list)
- Screenshots: taken by uptime.bet from a local SearXNG instance built from the official source on 30 November 2026.