Search engines stopped being tools and became surveillance devices. SearXNG flips that: a self-hosted metasearch engine that keeps your queries private and delivers ad-free results. Let’s build your own.

What Exactly Is SearXNG?

SearXNG is a fork of the original SearX project, designed to be a self-hosted metasearch engine. Instead of building its own index, it queries dozens of other engines—Google, DuckDuckGo, Wikipedia, torrent sites, and more—and aggregates the results. It strips your search terms of personal identifiers before forwarding them, so the upstream services never see your IP address, cookies, or browser fingerprint. You get the results without the tracking.

Because it’s open source and runs on your own hardware, you control everything: which engines to use, the UI, rate limits, and custom search plugins. It’s a Swiss Army knife for search that lives entirely in your homelab.

Why Self-Host a Search Engine?

Public SearXNG instances exist, but running your own gives you three big wins:

  • Trust: You know exactly what the code is doing. No admin peeking at logs or injecting ads.
  • Performance: A local instance returns results in milliseconds—no internet latency between you and the server.
  • Customization: Build profiles that search only academic papers, skip commercial sites, or use only privacy-respecting engines.

The trade-offs are real: you need an always-on machine (a Raspberry Pi 4 with 2 GB RAM handles a small household fine; for more users, an old laptop or mini PC works beautifully) and you’ll need to keep the software updated. We’ll cover that.

What You’ll Need Before Starting

  • Hardware: Any always-on computer with at least 1 GB free RAM and 2 GB disk space. A Pi 4, Intel NUC, or VM on Proxmox all work.
  • Operating System: Debian or Ubuntu Server (I’m using Ubuntu 22.04 LTS). Any Linux distro with Docker support will do.
  • Docker and Docker Compose: The easiest deployment method. Install via your package manager or the official convenience script.
  • A domain name (optional but recommended): You can use an IP address, but a domain with HTTPS is cleaner. A free DuckDNS subdomain or a paid domain both work.
  • Basic terminal comfort: You’ll SSH in and edit a few text files. I’ll walk through every command.

Step-by-Step Installation with Docker

We’ll use the official SearXNG Docker image. It bundles all dependencies and makes updates trivial.

1. Create the Project Directory

SSH into your server and set up a dedicated folder. I keep self-hosted services under /opt.

sudo mkdir -p /opt/searxng
cd /opt/searxng

2. Grab the Default Configuration Files

The SearXNG team provides a script that pulls the necessary config files:

sudo docker run --rm -v "${PWD}:/etc/searxng" searxng/searxng:latest \
  /usr/bin/searxng-config generate

This creates a searxng folder with settings.yml, uwsgi.ini, and limiter.toml. We’ll tweak these next.

3. Set Up the Docker Compose File

Create docker-compose.yml:

version: '3.7'

services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    ports:
      - "8080:8080"
    volumes:
      - ./searxng:/etc/searxng:rw
    environment:
      - SEARXNG_BASE_URL=https://your-domain.com/
    restart: unless-stopped

Replace https://your-domain.com/ with your actual domain later, or use http://localhost:8080/ for local-only testing. The volume mount keeps your config persistent across container updates.

4. Basic Configuration: settings.yml

Open searxng/settings.yml. Find the server: section and update:

server:
  secret_key: "your-unique-random-string"
  bind_address: "0.0.0.0"
  port: 8080
  base_url: https://your-domain.com/  # or false for local

Generate a strong secret key with openssl rand -hex 32. This encrypts sessions—don’t skip it.

Next, enable the engines you want. Many are disabled by default. Start with a good general-purpose mix:

  - name: duckduckgo
    engine: duckduckgo
    shortcut: ddg
    disabled: false

  - name: google
    engine: google
    shortcut: g
    disabled: false

  - name: wikipedia
    engine: wikipedia
    shortcut: wp
    disabled: false

  - name: startpage
    engine: startpage
    shortcut: sp
    disabled: false

You can enable dozens more—Bing, Qwant, Brave, torrent engines like 1337x—by setting disabled: false. Some engines rate-limit aggressively; if you see repeated errors, disable them and try alternatives.

5. Launch the Container

From /opt/searxng, run:

sudo docker compose up -d

Visit http://your-server-ip:8080. You should see the SearXNG interface. Try a query. If you get a blank page or errors, check the logs with sudo docker logs searxng. Common issues: missing secret key, or engines that need API keys (Google sometimes throws CAPTCHAs; starting with DuckDuckGo is safer).

Putting It Behind a Reverse Proxy with HTTPS

Plain HTTP on a local network is fine for testing, but if you want to use the engine from your phone or share it with family, you need encryption. I’ll use Nginx Proxy Manager (NPM) because it’s dead simple. If you already have Traefik or Caddy, the concept is the same.

Alternatively, if you’d rather keep your instance completely off the public internet, consider using Tailscale for encrypted access without opening any ports—we’ve covered that in Tailscale on Proxmox: Secure Access Without Open Ports.

Option A: Using Nginx Proxy Manager

If NPM isn’t installed, spin it up with Docker:

sudo docker run -d --name nginx-proxy-manager \
  -p 80:80 -p 443:443 -p 81:81 \
  -v /opt/npm/data:/data -v /opt/npm/letsencrypt:/etc/letsencrypt \
  --restart unless-stopped jc21/nginx-proxy-manager:latest

Access the admin panel at http://your-server-ip:81 (default login: [email protected] / changeme). Then:

  1. Add a new proxy host.
  2. Domain: search.yourdomain.com (make sure DNS points to your server’s public IP).
  3. Forward hostname/IP: your-server-ip (or searxng if NPM is on the same Docker network) and port 8080.
  4. Enable “Block Common Exploits” and “Websockets Support”.
  5. Under SSL, request a new Let’s Encrypt certificate. Force SSL.
  6. Save.

Now update searxng/settings.yml with base_url: https://search.yourdomain.com and restart the container:

sudo docker compose restart

Option B: Local-Only with a Self-Signed Certificate

For purely internal use, you can generate a self-signed certificate and configure NPM or Caddy to use it. Browsers will complain, though. I usually stick with Let’s Encrypt even for internal services by using a real domain with split-horizon DNS—it’s less hassle.

Using Your New Private Search Engine

Navigate to https://search.yourdomain.com. The interface is clean and minimal. Type a query and hit enter. SearXNG searches all your enabled engines and blends the results—no ads, no sponsored links.

Power-user features worth knowing:

  • Shortcuts: Type !g linux kernel to search only Google, !wp containers for Wikipedia, or !ddg privacy for DuckDuckGo. You can define custom shortcuts in settings.yml.
  • Preferences: Click the gear icon. Set default language, enable safe search, choose engines per category (general, images, videos, etc.), and change the theme. The “simple” theme is lightweight and fast.
  • Search categories: Tabs across the top (Files, Images, IT, Maps, Music, News, Science, Social Media, Videos) narrow results using subsets of engines. Configure these in settings.yml by assigning categories: to each engine.
  • Browser integration: To make SearXNG your default search engine, add a custom search engine with the URL https://search.yourdomain.com/search?q=%s. In Firefox, you can also click the three dots in the SearXNG search bar and select “Add as search engine”.

Customizing SearXNG to Fit Your Needs

Tailoring the engine to your workflow is where the real fun begins.

Tweaking the UI

Switch themes in settings.yml:

ui:
  default_theme: simple

For a custom look, mount a user.css file into the container. Example to darken the background:

body { background-color: #1e1e1e; color: #ccc; }

Engine Finetuning

Google often returns the best results but may require occasional CAPTCHA solving (SearXNG has experimental support, but it’s not perfect). If you want to avoid that, disable Google and rely on DuckDuckGo, Startpage, and Bing. For a fully privacy-focused setup, use only DuckDuckGo, Qwant, and Mojeek.

Engines that need API keys (like YouTube Data API v3) can be added with:

  - name: youtube
    engine: youtube_api
    shortcut: yt
    api_key: your-youtube-api-key
    disabled: false

Limiting Abuse

If you expose your instance to the internet, rate limiting is crucial. The limiter.toml defaults are sensible, but for a family instance you might double them:

[botdetection.ip_limit]
# 300 searches per day per IP
link_token = true
day = 300

You can also add HTTP authentication by configuring NPM with a .htpasswd file—perfect for sharing with a few friends without opening up to the world.

Maintenance and Keeping Things Healthy

SearXNG is low-maintenance, but a few regular tasks keep it smooth.

  • Updates: Pull the latest image monthly: sudo docker compose pull && sudo docker compose up -d.
  • Monitoring: Watch logs with sudo docker logs searxng -f --tail 50. If an engine consistently fails, disable it. Search engines change their APIs; updates usually fix breakages quickly.
  • Backups: The only thing you need to back up is the searxng config folder. I use a cron job to tar it up and copy it to my NAS weekly.
  • Performance: On a Raspberry Pi 4 with 2 GB RAM, SearXNG uses about 200 MB of memory and negligible CPU at idle. Under load, it might spike to 50% CPU momentarily. If you notice slowdowns, reduce the number of enabled engines or increase the timeout in settings.yml under outgoing:.

Honest Trade-Offs

SearXNG has a few rough edges. You’re at the mercy of upstream search engines—if Google changes its result parsing or throws a CAPTCHA, that engine might temporarily break. The community usually patches within days, but it’s not a set-it-and-forget-it service. Image and video search can be slower because SearXNG proxies previews from multiple sources. And if you’re used to personalized results (like Google’s location-aware restaurant searches), you’ll miss that—though you can set a default location in preferences.

But the control outweighs the quirks. Your data isn’t sold. You can block domains you dislike, add obscure academic engines, and shape the tool to your exact needs. It’s a constant reminder that the internet still belongs to us.

Wrapping Up

Running your own private search engine sounds massive, but with SearXNG and Docker it’s a weekend project that pays off every day. You get fast, ad-free results, total privacy, and a platform you can mold to your workflow. Start with a basic setup on a spare machine, then tweak the engines, theme, and access controls until it feels like home. Once you’ve tasted search without surveillance, it’s hard to go back. Grab that old Pi, fire up Docker, and give yourself the search engine you deserve.