DEV Community

James
James

Posted on

Self-Hosted Search: The €30/month Infrastructure Stack

Building a Self-Hosted Search Engine for Under €30/Month

You don't need Google's infrastructure to build a useful search engine. You need smart architecture and €30 per month.

The Stack

Component Tool Cost
VPS Hetzner CPX21 (4 vCPU / 8GB) €15/month
Meta-search SearXNG + custom aggregators Free
API queries Bing Search API ~€7/month
Caching Redis Free
Database PostgreSQL Free
Frontend Next.js on same VPS Free
Total €22/month

Architecture Decisions

Why Meta-Search Over Crawling

Crawling the entire web requires petabytes of storage and massive compute. Meta-search queries existing indexes (Bing, Brave, Mojeek, Wikipedia, GitHub) and ranks results locally. Coverage is 95%+ of what users actually need.

Why Hetzner

German data centers. EU jurisdiction. DSGVO-compliant by default. €15/month gets you more compute than AWS €50/month. No egress charges, no surprise bills.

Scaling Path

At 1,000 daily users: €22/month handles it.
At 10,000 daily users: Add a second VPS (€15) + load balancer (€5) = €42/month.
At 100,000 daily users: Then you think about Kubernetes. Not before.

The Technical Build

Backend: Python FastAPI handles query dispatch, result ranking, and caching. Each query hits 8-12 sources in parallel. Response time: 300-800ms.

Frontend: Next.js with server-side rendering. The server makes API calls, not the client. User IP never touches external search sources.

Privacy layer: Query text discarded after 30 seconds. No persistent logs. Aggregate analytics only.


Graham Miranda builds privacy-first search and automation tools at Graham Miranda UG (Berlin, HRB 36794).

Top comments (0)