Every search you make on Google, Bing, or even DuckDuckGo tells someone something about you. Search history builds a disturbingly accurate profile — your health concerns, financial situation, political interests, and everything in between. SearXNG flips that model entirely: you get the results, nobody gets your data.

SearXNG is a free, open-source metasearch engine that aggregates results from over 70 search engines simultaneously. It strips out tracking parameters, doesn’t log your queries, and runs entirely on your own server. Think of it as a search engine that works for you instead of advertisers.

What is SearXNG?

SearXNG is a fork of the original Searx project with an active development community and modern features. It pulls results from Google, Bing, DuckDuckGo, Wikipedia, Reddit, and dozens of other sources — then presents them in a clean, ad-free interface.

Why Self-Host SearXNG?

  • Zero tracking: No query logging, no cookies, no fingerprinting
  • Aggregated results: Combine 70+ search engines into one interface
  • Ad-free: Clean results without sponsored content cluttering your page
  • Customizable: Pick which engines to use, set default categories, tweak ranking
  • Multiple formats: Search web, images, videos, news, maps, files, and more
  • API access: Use it as a search backend for other tools (like AI assistants)
  • Lightweight: Runs comfortably on minimal hardware

Prerequisites

Before starting, you’ll need:

  • A Linux server (Ubuntu 22.04+ or Debian 12+ recommended)
  • Docker and Docker Compose installed
  • A domain name pointed at your server (optional but recommended)
  • A reverse proxy like Nginx Proxy Manager, Traefik, or Caddy
  • At least 512MB RAM

Step 1: Create the Project Directory

mkdir -p ~/searxng && cd ~/searxng

Step 2: Create the Docker Compose File

Create docker-compose.yml:

services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    ports:
      - "8888:8080"
    volumes:
      - ./settings:/etc/searxng
    environment:
      - SEARXNG_BASE_URL=https://search.yourdomain.com/
    restart: unless-stopped
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"

Replace https://search.yourdomain.com/ with your actual domain, or use http://localhost:8888/ for local-only access.

Step 3: Configure SearXNG Settings

Create the settings directory and main configuration:

mkdir -p settings

Create settings/settings.yml:

use_default_settings: true

general:
  instance_name: "My Search"
  debug: false
  privacypolicy_url: false
  contact_url: false

search:
  safe_search: 0
  autocomplete: "google"
  default_lang: "en"

server:
  secret_key: "CHANGE_THIS_TO_A_RANDOM_STRING"
  limiter: true
  image_proxy: true
  method: "POST"

ui:
  static_use_hash: true
  default_theme: "simple"
  infinite_scroll: true

enabled_plugins:
  - 'Hash plugin'
  - 'Self Information'
  - 'Tracker URL remover'
  - 'Open Access DOI rewrite'

Generate a proper secret key:

sed -i "s/CHANGE_THIS_TO_A_RANDOM_STRING/$(openssl rand -hex 32)/" settings/settings.yml

Step 4: Configure Rate Limiting (Optional)

Create settings/limiter.toml to protect your instance from abuse:

[botdetection.ip_limit]
link_token = true

This enables basic bot detection. If you’re exposing your instance to the internet, this prevents search engines from hammering your server and getting your IP flagged.

Step 5: Start SearXNG

docker compose up -d

Check the logs to make sure everything started correctly:

docker compose logs -f

You should see SearXNG initialize and start listening. Once it’s ready, visit http://your-server-ip:8888 in your browser.

Step 6: Set Up a Reverse Proxy

For production use with HTTPS, put SearXNG behind a reverse proxy. If you’re using Nginx Proxy Manager:

  1. Add a new proxy host
  2. Set the domain to search.yourdomain.com
  3. Forward to http://searxng:8080 (or your server IP and port 8888)
  4. Enable SSL with Let’s Encrypt
  5. Under Advanced, add these headers:
proxy_set_header   X-Forwarded-For    $remote_addr;
proxy_set_header   X-Real-IP          $remote_addr;
proxy_set_header   X-Forwarded-Proto  $scheme;

If you’re using Traefik, add labels to your Docker Compose:

labels:
  - "traefik.enable=true"
  - "traefik.http.routers.searxng.rule=Host(`search.yourdomain.com`)"
  - "traefik.http.routers.searxng.entrypoints=websecure"
  - "traefik.http.routers.searxng.tls.certresolver=letsencrypt"
  - "traefik.http.services.searxng.loadbalancer.server.port=8080"

Step 7: Customize Search Engines

SearXNG supports a massive list of search engines. To fine-tune which engines are active, add an engines section to your settings.yml:

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

  - name: bing
    engine: bing
    shortcut: b
    disabled: false

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

  - name: reddit
    engine: reddit
    shortcut: r
    disabled: false

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

  - name: github
    engine: github
    shortcut: gh
    disabled: false

You can also disable engines you don’t want directly in the web UI under Preferences → Engines.

Step 8: Set SearXNG as Your Default Search Engine

Firefox

  1. Visit your SearXNG instance
  2. Click the address bar
  3. Look for the green “+” icon to add it as a search engine
  4. Go to Settings → Search → Default Search Engine → select your instance

Chrome/Brave

  1. Go to Settings → Search engine → Manage search engines
  2. Add a new search engine:
    • Name: SearXNG
    • Keyword: @s
    • URL: https://search.yourdomain.com/search?q=%s
  3. Set as default

Using the API

SearXNG also exposes a JSON API, making it perfect as a search backend:

curl "https://search.yourdomain.com/search?q=docker+compose&format=json" | jq '.results[:3]'

This is incredibly useful for piping search results into scripts, AI tools, or automated workflows.

Troubleshooting

SearXNG Returns No Results

Some search engines block requests from servers. Try:

  • Enable different engines in Preferences
  • Check if your server IP is blocked by Google (common on VPS providers)
  • Enable the image_proxy setting to avoid direct connections
  • Use method: "POST" in server settings to reduce fingerprinting

High CPU Usage

If search queries spike your CPU:

server:
  limiter: true

outgoing:
  request_timeout: 5.0
  max_request_timeout: 15.0
  pool_connections: 100
  pool_maxsize: 10

This limits concurrent outgoing requests and sets timeouts.

Container Won’t Start

Check permissions on the settings directory:

# SearXNG runs as user 977 inside the container
chown -R 977:977 ./settings

CAPTCHA Errors

If you see CAPTCHA warnings for Google results, your IP may be flagged. Solutions:

  • Use the instance privately (don’t share publicly)
  • Rely more on Bing, DuckDuckGo, and other engines
  • Consider rotating through a VPN or proxy for outgoing requests

Advanced: Using SearXNG with AI Tools

One of the best use cases for a self-hosted SearXNG instance is pairing it with AI tools. Many AI frameworks support SearXNG as a search provider:

  • Ollama + Open WebUI: Configure SearXNG as the web search backend
  • LangChain: Use the SearXNG wrapper for RAG pipelines
  • Home Assistant: Feed search results into automations

The JSON API makes integration straightforward — any tool that can make HTTP requests can use your private search engine.

Updating SearXNG

cd ~/searxng
docker compose pull
docker compose up -d

SearXNG updates frequently with new engines and fixes. Pull updates every few weeks to stay current.

Conclusion

SearXNG gives you what search engines should have been all along — a tool that finds what you’re looking for without building a profile on you in the process. Self-hosting it means your queries never leave your server, you get results from dozens of sources simultaneously, and you can customize every aspect of the experience.

Combined with a reverse proxy and SSL, you’ve got a production-ready private search engine that works as your browser’s default, an API backend for your tools, or a shared resource for your household. For a container that uses barely any resources, that’s a lot of value.