Tutorial

How to Run a Private SearXNG Instance on Windows

If you're tired of search engines tracking every query, serving targeted ads, and wrapping your results in AI overviews you didn't ask for, the solution is SearXNG.

SearXNG is a free, privacy-respecting meta-search engine. It acts as a middleman: you search SearXNG, and it queries Google, Bing, DuckDuckGo, and Wikipedia on your behalf. The upstream search engines only see SearXNG's IP address, not yours. They can't fingerprint your browser or build a profile on you.

While most guides assume you're running Linux, setting this up on a standard Windows machine is surprisingly easy thanks to Docker and WSL2. Here is the exact setup I use to power the news feed on Rocky's Labs.

Prerequisites

  • Windows 10 or 11 (Pro or Home)
  • Docker Desktop installed and running (ensure WSL2 integration is enabled in Settings > Resources > WSL Integration)
  • A code editor (like VS Code or Notepad++)

1. Create the Directory Structure

Open your command prompt or PowerShell and create a new directory for your SearXNG setup. I like to keep everything organized in a dedicated folder.

mkdir C:\searxng
cd C:\searxng

2. Configure docker-compose.yml

Create a file named docker-compose.yml in your C:\searxng directory. This file tells Docker exactly how to run the SearXNG container and what ports to expose.

version: "3"
services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    ports:
      - "8080:8080"
    volumes:
      - ./searxng-data:/etc/searxng
    environment:
      - SEARXNG_BASE_URL=http://localhost:8080/
    restart: unless-stopped

Security Note: We are mapping port 8080. If you are exposing this to the public web later, you should put a reverse proxy (like Caddy or Nginx) in front of it to handle HTTPS.

3. Create the Configuration File (settings.yml)

SearXNG requires a settings.yml file to define which search engines are active and to configure a secret key. First, create the mapped directory:

mkdir C:\searxng\searxng-data

Next, create a file named settings.yml inside the C:\searxng\searxng-data folder. You can customize this extensively, but here is a solid starting configuration:

# C:\searxng\searxng-data\settings.yml
use_default_settings: true

server:
  # Generate a unique string for your secret key!
  secret_key: "CHANGE_THIS_TO_A_RANDOM_LONG_STRING"
  bind_address: "0.0.0.0"
  port: 8080
  image_proxy: true
  
search:
  safe_search: 0
  autocomplete: "google"

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

4. Boot it Up

With Docker Desktop running in the background, go back to your PowerShell terminal (make sure you are in C:\searxng) and run:

docker-compose up -d

Docker will download the latest SearXNG image and start the container in detached mode (-d). Once it finishes, open your web browser and navigate to:

http://localhost:8080

You should see the clean, minimalist SearXNG search interface. Try a search! You are now pulling aggregated results without being tracked.

5. Using SearXNG as an API

The beauty of self-hosting SearXNG is that it can act as a JSON API for your own scripts and agents. To get results in JSON format instead of HTML, just append &format=json to your search query.

Example: http://localhost:8080/search?q=artificial+intelligence&format=json

This is exactly how the live news feed on Rocky's Labs operates โ€” it queries a local SearXNG container and parses the JSON response to feed into our local LLM for screening.

โ€” Rakesh Ganesan
Rocky's Labs ยท 27 May 2026