SearXNG: host your own private search engine
SearXNG is a free, AGPL-licensed metasearch engine: it sends your query to engines such as Google, Bing and DuckDuckGo, strips cookies and tracking, and shows the combined results on one page. You can run it with the official Docker Compose template on any small Linux server, but a private instance does not hide your queries from those engines, so decide first whether self-hosting or a trusted public instance fits you better.
At a glance
| Item | What applies |
|---|---|
| Official install route | Compose template in the main SearXNG repo (searxng-docker is superseded) |
| Containers | searxng-core (SearXNG) and searxng-valkey (Valkey, for the limiter) |
| Image | docker.io/searxng/searxng, mirrored at ghcr.io/searxng/searxng |
| Architectures on Docker Hub | amd64, arm64, arm/v7 |
| Main config file | core-config/settings.yml (mounted at /etc/searxng/) |
| Bot protection | server.limiter: true plus a Valkey URL |
| Release model | Rolling release; images are tagged by date and commit |
| What to back up | core-config/, .env and docker-compose.yml |
Not sure whether to run it at home or on a rented server? The VPS vs home server vs managed comparison walks through the trade-offs, and what self-hosting involves covers the day-to-day work.
What a metasearch engine can and cannot hide
SearXNG has no index of its own. Each search becomes a set of requests from your server to the upstream engines, and SearXNG merges what comes back. According to the project’s Why use a private instance? page, it removes cookies, generates a random browser profile for every request, serves no ads, and hides your query and the referring page from the result sites you click.
The limits matter just as much:
- Upstream engines still see the instance’s IP address and the query text. The docs say so directly: “The IP address used will be the IP of the instance.” SearXNG can send engine traffic through a proxy or Tor (the
outgoing:settings, withsocks5h://recommended for Tor), but that is extra setup and slows results. - One user is easy to profile. On a busy public instance your searches mix with everyone else’s. On a private instance used by one person, every query from that IP is yours. Host it at home and the engines see your home IP, which is no better than searching directly as far as IP privacy goes. On a VPS they see an IP that is billed to you.
- Engines push back. The docs note that instances without protection can be hit with CAPTCHAs or IP bans from upstream engines, which means fewer results.
What you gain is control: no unknown operator can log your searches, your preferences live in your own settings.yml instead of a cookie, and you choose which engines to query. If that is the goal, keep reading. If you mainly want to stop a search company from building a profile tied to your IP, a busy public instance run by people you trust does that better.
Install with Docker Compose
The Installation container page is the current official route. The older searxng-docker repository now opens with a notice that it is superseded and points new installs back to that page. You need Docker (or Podman) with the Compose plugin on a Linux server; a small VPS or a Raspberry Pi home server is enough for personal use, since the image is published for arm64 and arm/v7 as well as amd64. The VPS guide covers picking a server.
The setup commands from the docs create a folder, then download two files from the SearXNG repository: docker-compose.yml (two services, SearXNG and Valkey, with named volumes for their data) and .env.example (commented-out variables for the image tag, listen address and port). Nothing else is executed.
# Create the environment and configuration directories
$ mkdir -p ./searxng/core-config/
$ cd ./searxng/
# Fetch the latest compose template
$ 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
Copy the example file to .env:
$ cp -i .env.example .env
$ nano .env
The Compose file publishes port 8080 on every interface unless SEARXNG_HOST is set. Because you will put nginx in front, bind it to localhost by uncommenting that line in .env and changing the address:
# Listen to a specific address.
SEARXNG_HOST=127.0.0.1
Then start the services:
$ docker compose up -d
On first start the container’s entrypoint script checks for core-config/settings.yml. If the file is missing, it copies a short template (use_default_settings: true, a placeholder secret_key and image_proxy: true) and replaces the placeholder with a random key. docker compose ps should list searxng-core and searxng-valkey, and docker compose logs -f core shows the startup log.
Basic settings in settings.yml
With use_default_settings: true, your file only holds the values that differ from SearXNG’s built-in defaults, as described on the settings.yml page. Edit core-config/settings.yml so it looks like this, keeping the generated key:
use_default_settings: true
general:
instance_name: "SearXNG"
contact_url: mailto:admin@example.org
server:
base_url: https://search.example.org/
secret_key: "CHANGE_ME" # keep the random value generated on first start
limiter: true
public_instance: false
image_proxy: true
valkey:
url: valkey://valkey:6379/0
What each key does, per the server and general settings pages:
secret_keyis used for cryptography. Never leave it at the defaultultrasecretkey.base_urlis the public address, used to build correct links.instance_nameis the name shown in the interface.contact_urlis a mailto address or web form. The docs say it is required to comply with the policies of Wikidata and other services SearXNG queries.limiterturns on bot protection and needs thevalkey:section.public_instanceenables extra protections meant for public instances (see below).image_proxyroutes result images through your instance so image hosts do not see your browser. It uses memory.
The valkey URL follows the docs’ example (valkey://localhost:6379/0) with the hostname changed to valkey, the Compose service name; the migration notes in the container docs name valkey or searxng-valkey as the hostname to use.
To choose engines, the docs show two forms. Remove engines from the default set:
use_default_settings:
engines:
remove:
- google
Or keep only the ones you list:
use_default_settings:
engines:
keep_only:
- google
- duckduckgo
Either form replaces the use_default_settings: true line. To switch on an engine that is disabled by default, add it under engines: with disabled: false, as in the docs’ example for bing. Restart with docker compose down and docker compose up -d after changes.
Bot protection: the limiter and Valkey
The Limiter exists because SearXNG passes bot traffic through to the engines, which then treat your instance as a bot and answer with CAPTCHAs or blocks. It checks HTTP headers, applies IP block and pass lists, and rate-limits clients by behavior, storing hashed IPs in Valkey.
It only works if it sees each visitor’s real IP, which it reads from the X-Forwarded-For and X-Real-IP headers sent by trusted proxies. The default limiter.toml trusts only 127.0.0.0/8 and ::1. With Docker, nginx reaches the container through a published port, so requests usually arrive from a Docker bridge address instead. If that applies to you, create core-config/limiter.toml (mounted as /etc/searxng/limiter.toml) and uncomment the range that contains your Compose network’s gateway; docker network inspect searxng_default shows the subnet. The docs advise overriding only what you need:
[botdetection]
trusted_proxies = [
'127.0.0.0/8',
'::1',
'172.16.0.0/12',
]
To give your home network unrestricted access, the same file supports a pass_ip list under [botdetection.ip_lists].
Private or public instance
A private instance is one only you, family or colleagues use. The simplest version never faces the internet at all: leave SEARXNG_HOST=127.0.0.1 and reach it through a VPN or SSH tunnel, as the docs suggest for company instances. In that case the limiter is optional. If it does face the internet, even unadvertised, keep limiter: true so scanners and scrapers cannot get your server’s IP blocked, and keep public_instance: false.
A public instance needs public_instance: true. According to the server settings docs, that turns on image_proxy and the limiter’s link_token method. The Bot Detection docs explain that link_token marks a client as suspicious if it never loads a stylesheet URL containing a random token, which real browsers do and simple bots do not, and then applies lower rate limits to it. Running a public instance also means answering abuse reports and keeping up with upstream changes; to be listed on searx.space you open an issue in the searx-instances repository and allow its checker to reach your instance.
If an engine starts returning CAPTCHAs anyway, the docs’ Answer CAPTCHA page uses an SSH SOCKS tunnel so you can solve it from the server’s IP:
$ ssh -q -N -D 8080 user@example.org
Point your browser’s SOCKS5 proxy at 127.0.0.1:8080, open the blocking engine and solve the CAPTCHA.
TLS with an nginx reverse proxy
The NGINX page gives a proxy block for SearXNG under a /searxng path. For a subdomain such as search.example.org, serve it at /, drop the X-Script-Name header (only needed for a sub-path) and point proxy_pass at the container’s port:
server {
listen 80;
server_name search.example.org;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header Connection $http_connection;
# see flaskfix.py
proxy_set_header X-Forwarded-Proto $scheme;
# see botdetection/trusted_proxies.py
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
The X-Real-IP and X-Forwarded-For lines are what the limiter relies on. With DNS for search.example.org pointing at the server and port 80 open, Certbot’s nginx plugin obtains a Let’s Encrypt certificate and edits this server block for HTTPS. The Certbot user guide recommends backing up your nginx configuration first:
certbot --nginx
The guide says most Certbot installations come with automatic renewal, and certbot renew --dry-run tests the renewal setup. For more privacy, the SearXNG docs also show turning off nginx’s logs in /etc/nginx/nginx.conf:
http {
# ...
access_log /dev/null;
error_log /dev/null;
# ...
}
Valkey is never published to the host by the Compose file, and SearXNG has no admin login, so the only remaining management surface is SSH. Use key-based logins and keep everything except ports 80 and 443 firewalled.
Updates and backups
SearXNG is a rolling release: per the maintenance docs, every commit to the master branch is a release, and Docker Hub carries date-and-commit tags alongside latest. Engines break when upstream sites change, so update regularly. The container docs give these commands:
$ docker compose down
$ docker compose pull
$ docker compose up -d
Now and then, refresh the Compose template too, and compare it with your .env. The docs print this step as curl -fsSLO followed by both URLs, but curl’s -O applies to one URL each, so that form saves only docker-compose.yml and prints .env.example to the terminal. The version below repeats -O, as the docs’ own setup command does:
$ docker compose down
$ 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
$ docker compose up -d
If you would rather not take every change, set SEARXNG_VERSION in .env to a specific tag and move it forward on your own schedule. Also read the “Migrate and stay tuned” section of the maintenance page before big jumps; it lists infrastructure changes such as the move to Valkey for bot protection.
Backups are small. SearXNG keeps no accounts or search history; user preferences live in browser cookies. Copy core-config/ (your settings.yml and limiter.toml), .env and docker-compose.yml. The named volumes hold a favicon cache and the limiter’s short-lived Valkey data, both of which rebuild on their own.
If you prefer not to use containers, the docs also offer an installation script, utils/searxng.sh, run from a clone of the repository. Run with sudo, it creates a searxng user and installs a reference setup with uWSGI. The docs say to update the OS first, to run it from a sudo-capable login rather than as root, and to clone the repository somewhere the new user can read (not under /root).
Using a public instance instead
For many people a public instance is the better choice, and the SearXNG docs say as much for anyone trying it out or searching on the go. The project’s default settings.yml links to searx.space as its list of public instances. The list’s code and instance registry live in the SearXNG GitHub organization, and a checker grades each instance on TLS, security headers, uptime, response times and which engines work, and flags the hosting network and country.
The trade is trust: the operator can log your queries, so pick an instance run by people or an organization you are comfortable with, and check that it has a privacy policy. Your IP is hidden from Google and Bing, but not from the instance.
For other ways to search without being tracked, see the private search hub.
Frequently asked questions
- Does running my own SearXNG instance make me anonymous?
- No. Upstream engines such as Google or Bing see your server's IP address and every query it sends. SearXNG strips cookies and randomizes the browser profile, but a single-user instance means all of those queries come from one IP that is linked to you. A busy public instance mixes your searches with many other people's.
- Is the searxng-docker repository still the way to install SearXNG?
- No. The searxng-docker README now says the repository is superseded. New installs should use the Compose template in the main SearXNG repository, described on the Installation container page of the docs, which also has a migration section for existing searxng-docker setups.
- Do I need Valkey or Redis?
- Only for the limiter, SearXNG's bot protection. The docs say the limiter requires a Valkey database, and the official Compose file already starts a Valkey container next to SearXNG. You still have to point settings.yml at it and set limiter to true.
- Why do some engines return no results on my instance?
- Upstream engines rate-limit or show CAPTCHAs to IP addresses that look automated. The docs describe opening an SSH SOCKS tunnel to the server so you can solve the CAPTCHA from the server's IP in your own browser. Turning on the limiter also helps by stopping bots from using your instance.
- What is a good public SearXNG instance?
- Pick one from searx.space, the instance list maintained in the SearXNG GitHub organization. It shows each instance's TLS grade, uptime, response times and hosting network. Choose one run by people you trust, because the operator can see your queries.
Sources, checked December 2, 2026
- SearXNG docs: Installation container
- SearXNG repository: container/docker-compose.yml
- SearXNG repository: container/.env.example
- SearXNG repository: container entrypoint.sh (first-start settings and secret key)
- SearXNG repository: container/settings.template.yml
- searxng-docker README (superseded notice)
- SearXNG image tags on Docker Hub
- SearXNG docs: settings.yml and use_default_settings
- SearXNG docs: server settings
- SearXNG docs: general settings
- SearXNG docs: valkey settings
- SearXNG docs: outgoing settings (proxies and Tor)
- SearXNG docs: Limiter
- SearXNG docs: Bot Detection (link_token)
- SearXNG docs: Why use a private instance?
- SearXNG docs: Answer CAPTCHA from server's IP
- SearXNG docs: NGINX
- SearXNG docs: SearXNG maintenance (rolling release)
- SearXNG docs: Installation Script
- SearXNG README (AGPL-3.0 licence)
- searx.space public instance list
- searx-instances repository (how instances are added to searx.space)
- curl manual: -O, --remote-name
- Certbot user guide: Nginx plugin and renewal