SearXNG — Privacy-focused metasearch engine for your homelab

📆 · ⏳ 4 min read · ·

Introduction

Welcome to another week of self-hosting various services in my homelab. This week, we’ll be exploring search engines - specifically, how to maintain privacy while searching the web.

Search engines are our primary gateway to the internet i.e we use them to find information, products, services, etc. However, most popular search engines track our searches, build profiles, and use this data for targeted advertising. While there are privacy-focused alternatives like DuckDuckGo, Kagi, etc. having your own metasearch engine gives you complete control over your search experience.

That’s where SearXNG comes in - a powerful, privacy-focused metasearch engine that you can self-host. What makes it special isn’t just its commitment to privacy, but how it aggregates results from multiple search engines while keeping your searches private.

What is a Metasearch Engine?

A metasearch engine is a search tool that queries multiple search engines (can be as few as 1) simultaneously and combines their results into a single, unified response. Think of it as a search aggregator that:

  1. Distributes Queries: Sends your search to multiple search engines
  2. Aggregates Results: Combines and deduplicates results from different sources
  3. Maintains Privacy: Acts as an intermediary, preventing direct tracking
  4. Customizes Experience: Allows you to choose which engines to include

What is SearXNG?

SearXNG ↗️ is a free internet metasearch engine that aggregates results from various search services and databases. It’s a fork of Searx ↗️ with additional features and improvements.

What really drew me to SearXNG was its comprehensive feature set:

  1. Privacy Features:

    • No tracking or profiling
    • No cookies by default
    • Proxy support for anonymous requests
  2. Search Capabilities:

    • Support for 230+ search engines
    • Category-based search
    • Time-based filtering
    • Language preferences
    • Safe search options
  3. User Experience:

    • Clean, minimalist interface
    • Mobile-friendly design
    • Keyboard shortcuts
    • Customizable themes
    • Multiple language support
  4. Technical Features:

    • Docker support
    • API access
    • Proxy support
    • Rate limiting
    • Caching options

The project is open-source and actively maintained. You can check out their GitHub repository ↗️ for more details.

Setup SearXNG

Once again, I am going to be using Docker to run SearXNG in my homelab. First, create a new directory:

Terminal window
mkdir searxng && cd searxng

Here’s my docker-compose configuration:

services:
searxng:
image: "docker.io/searxng/searxng:latest"
container_name: "searxng"
volumes:
- "./config:/etc/searxng:rw"
ports:
- "8080:8080"
environment:
- PGID=1000
- PUID=1000
- SEARXNG_BASE_URL=https://search.mydomain.com
- SEARXNG_REDIS_URL=redis://redis:6379/0
- UWSGI_WORKERS=4
- UWSGI_THREADS=4
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
redis:
container_name: searxng-redis
image: docker.io/valkey/valkey:8-alpine
command: valkey-server --save 30 1 --loglevel warning
restart: unless-stopped
volumes:
- "redis-data:/data"
cap_drop:
- ALL
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
- CHOWN
healthcheck:
test: ["CMD", "valkey-server", "--version"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
redis-data:

Create the necessary directories:

Terminal window
mkdir -p {config}

Now you can start SearXNG:

Terminal window
docker compose up -d

The above setup uses Redis as the cache backend with Valkey as the Redis server, however you can use any other Redis server or even no cache at all.

Enjoying the content? Support my work! 💝

Your support helps me create more high-quality technical content. Check out my support page to find various ways to contribute, including affiliate links for services I personally use and recommend.

Configuration and Customization

After setting up SearXNG, here are some important configurations I recommend:

  1. Search Engine Selection:

    • Go to Preferences → Search engines
    • Enable engines based on your needs
    • I recommend enabling:
      • General: Google, Bing, DuckDuckGo
      • News: wikinews
  2. Privacy Settings:

    • Enable “Safe search” if needed
    • Set “Results per page” to your preference
    • Configure “Time range” defaults
    • Set your preferred language
  3. Performance Tuning:

    • Adjust worker and thread counts based on your server
    • Configure caching if needed
    • Set up rate limiting to prevent abuse

Integration with Librewolf

I use Librewolf ↗️ as my primary browser, and I’ve configured it to use my self-hosted SearXNG instance as the default search engine. Here’s how to do it:

  1. Open Librewolf settings (Or directly go to about:preferences#search)

  2. Go to Search

  3. Click “Add Search Engine”

  4. Enter the following details:

    • Name: SearXNG
    • URL: https://search.mydomain.com/search?q=%s
  5. Set it as the default search engine.

Features I Love

After using SearXNG for several months, here are some features that I find particularly useful:

  1. Privacy First: No tracking, no cookies, no history - just pure search.

  2. Customizable Interface: Clean, minimalist design that’s easy to use.

  3. Multiple Search Engines: Results from various sources give me comprehensive results.

  4. Category-based Search: Helps me find specific types of content more efficiently.

Conclusion

SearXNG has become my go-to search solution, providing a perfect balance of privacy, functionality, and control. Combined with Librewolf, it creates a privacy-focused browsing experience that I can trust.

Do you use SearXNG or similar privacy-focused search solutions in your homelab? What are your favorite features? Share your experiences in the comments below, or reach out to me on Twitter ↗️ / Reddit ↗️.

Happy searching! 🔍

You may also like

  • # homelab# selfhosted

    Stirling PDF — Self-hosted PDF manipulation powerhouse

    Stirling PDF is a powerful, locally hosted web application that allows you to perform various operations on PDF files. Learn how to set it up and automate PDF processing in your homelab.

  • # homelab# selfhosted

    n8n — Powerful automation for your homelab services

    n8n is a powerful workflow automation tool that helps you connect and automate your self-hosted services. Perfect for creating custom workflows and integrations in your homelab.

  • # homelab# selfhosted

    Paperless-ngx — Self-hosted document management that actually makes sense

    Paperless-ngx is a powerful document management system that helps you go paperless by automatically organizing and making your documents searchable. Perfect for managing bills, receipts, and important documents in your homelab.