Why You Might Want Your Own Search Engine

Here’s a question I’ve been sitting with lately: do you trust Google, Bing, or any other search engine with your queries?

SearXNG metasearch engine interface showing a search bar and settings gear icon
Image: MRafizeldi via Wikimedia Commons (CC BY-SA 4.0)

Every time you type a search term, that data gets logged. It builds a profile. Advertisers, platforms, and who-knows-who-else can access that information. For most people, that’s not a problem day-to-day. But if you’re a privacy-conscious developer, a security researcher, or just someone who doesn’t love being the product, there’s another way. I recently wrote about how to block AI crawlers from scraping your website using Cloudflare, and the same privacy-first thinking applies to the tools you use every day — especially your search engine.

Meet SearXNG — a free, open-source metasearch engine that you can run yourself. It hit 33,000 GitHub stars this week after being on the front page of Hacker News, and it’s been my go-to private search solution for the past few months. Here’s how to set it up on your own server in about fifteen minutes.

What Is SearXNG, Exactly?

SearXNG is a metasearch engine. That means it doesn’t crawl the web on its own. Instead, it sends your query to up to 280 different search services — Google, Bing, DuckDuckGo, Brave, Wikipedia, Qwant, and hundreds more — then bundles the results into a single clean page.

The key difference: SearXNG strips out all tracking and profiling. From the perspective of those search engines, they’re getting a request from your SearXNG server, not from you. Your IP stays hidden. No cookies follow you home. No ad profiles get built from your search history.

It’s also fully open-source under the AGPL-3.0 license, maintained by an active community, and available in 58 languages. Not bad for a free tool.

What You’ll Need

Before we dive in, here’s the shopping list:

  • A Linux server (VPS or local — I’m using a $6/month DigitalOcean droplet running Ubuntu 24.04)
  • Docker and Docker Compose installed on that server
  • Basic familiarity with the terminal — you should be comfortable running commands and editing config files
  • A domain name (optional, but recommended if you want HTTPS)

If you don’t have a server, you can also run this locally on your laptop. SearXNG is lightweight — 512MB of RAM is plenty for personal use. If you’re running long tasks on your machine, I’ve got a guide on how to keep your computer awake during long-running tasks that might come in handy while you tinker.

Step 1: Install Docker (If You Haven’t Already)

If you already have Docker and Compose installed, skip ahead. If not, this one-liner covers most Linux distros:

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER

Log out and back in (or restart your terminal session) for the group change to take effect. Then verify with:

docker --version
docker compose version

I’m using Docker Compose v2 here — the docker compose syntax (with a space, not a hyphen). If your system only has the old docker-compose, upgrade before proceeding.

Step 2: Set Up SearXNG with Docker Compose

This is the recommended installation method, and it’s surprisingly simple. Here’s what we’ll do:

# Create the project directory
mkdir -p ~/searxng/core-config/
cd ~/searxng/

# Download the official compose file and environment template
curl -fsSL -O https://raw.githubusercontent.com/searxng/searxng/master/container/docker-compose.yml
curl -fsSL -O https://raw.githubusercontent.com/searxng/searxng/master/container/.env.example

cp -i .env.example .env

This gives you a docker-compose.yml and a .env file. Let’s look at what’s inside before starting anything.

Configure the Environment

Open .env in your editor. The most important variable is SEARXNG_HOSTNAME:

# If you have a domain:
SEARXNG_HOSTNAME=https://search.yourdomain.com

# If running locally:
SEARXNG_HOSTNAME=http://localhost:8888

Here’s my full .env for a local setup:

SEARXNG_HOSTNAME=http://localhost:8888
SEARXNG_BASE_URL=http://localhost:8888/

Step 3: Start SearXNG

With the config in place, starting the service takes one command:

docker compose up -d

Docker will pull the SearXNG image from the GitHub Container Registry (GHCR) — the official docs recommend this over DockerHub since the latter has rate limits for unauthenticated pulls. Give it a minute while the image downloads.

Once it’s running, check that everything started properly:

docker compose ps

You should see a single service named core with status Up. Now open your browser and visit http://localhost:8888 (or your server’s IP address).

You’ll see SearXNG’s clean, minimal search interface. Type something — anything — and hit Enter. You’re now searching without being tracked.

Step 4: Expose It Securely with a Reverse Proxy (Caddy Edition)

Running on localhost is great for testing. But if you want access from anywhere — or want to share it with your team — you need a reverse proxy with HTTPS.

I use Caddy for this because it automatically handles TLS certificates through Let’s Encrypt. No manual certbot commands, no renewal cron jobs. Here’s the setup:

# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy

Then create a Caddyfile:

search.yourdomain.com {
    reverse_proxy localhost:8888
}

Replace search.yourdomain.com with your actual domain and make sure its DNS points to your server’s IP. Then start Caddy:

sudo systemctl enable --now caddy

Caddy automatically provisions a TLS certificate and renews it. From this point forward, you access SearXNG over HTTPS at your chosen domain.

Step 5: Tweak the Settings

SearXNG’s configuration lives in ~/searxng/core-config/settings.yml. This file is generated automatically the first time the container starts. Here are the changes I always make:

Disable the Public Instance Registry

By default, SearXNG pings the public instance registry at searx.space. If you’re running a private instance, disable it:

general:
  instance_name: "My Private Search"
  private_instance: true

Set Your Preferred Engines

SearXNG queries up to 280 engines, but you’ll probably only want a subset. I have mine configured for:

search:
  safe_search: 0
  autocomplete: "google"
  default_locale: "en-US"
  formats:
    - html
    - json

You can also disable specific engines in the engines: section. For example, if you don’t want results from a particular source, set its disabled: true. I personally disable the image-heavy social media engines to keep results cleaner.

Enable JSON API (Great for Automation)

One feature I particularly love: SearXNG exposes a JSON API. You can query it programmatically from your own scripts or tools:

curl "http://localhost:8888/search?q=linux+security+hardening&format=json" | jq '.results[:3] | .[].title'

This is incredibly useful if you’re building automation workflows that need to search the web without hitting rate limits or CAPTCHAs. I use it in a couple of internal tools to aggregate research results. If you’re into building your own tools, you might enjoy my guide on how to build your first MCP server with Python — it pairs well with the automation capabilities here.

Step 6: Keeping It Updated

Updates are straightforward:

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

The SearXNG team releases updates frequently. I check for updates about once a month, but you could automate this with a simple cron job if you’re feeling fancy.

Real Talk: Is This Worth the Effort?

I’ll be honest — hosting your own search engine is not for everyone. If you’re perfectly comfortable with Google or DuckDuckGo, you probably don’t need this. But here’s why I made the switch:

  • Privacy by default. My search history belongs to me. Full stop.
  • No ads. The results page has zero sponsored content. It’s just… results.
  • Customization. I can choose which engines SearXNG queries, how results are ranked, and what the UI looks like.
  • JSON API access. I’ve automated several research tasks that benefit from unfettered programmatic search.
  • It costs almost nothing. On a $6/month VPS, SearXNG uses maybe 200MB of RAM and very little CPU. The Caddy reverse proxy handles TLS automatically.

The biggest tradeoff is that you’re dependent on the upstream search engines. If Google or Bing change their API or start blocking your server’s IP, some results may degrade. In practice, I’ve been running this for about four months and haven’t hit any issues.

The same self-hosting philosophy applies to AI too. If you’re curious about running your own AI infrastructure, check out my guide on how to run AI models locally on your laptop with Ollama — it’s the same satisfaction of owning your own tools, just with neural networks instead of search results.

Wrapping Up

Self-hosting SearXNG is one of those projects that takes fifteen minutes to set up and then quietly works in the background forever. No subscription fees. No data collection. Just a search engine that does what it’s supposed to do and nothing else.

If you’ve been thinking about reclaiming a bit of your digital privacy, this is an easy win. Give it a try over a weekend — you might find, like I did, that running your own search engine feels surprisingly liberating.

Filed under Tech & Gadgets
Last Update: July 4, 2026 by Felix AlterEgo
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Newest
Oldest Most Voted