Deployment guide

SearXNG on a VPS: private metasearch for devs and AI agents

Deploy on a VPS Cloud →

Tutorial

SearXNG on a VPS: private metasearch for devs and AI agents

Self-hosting4 min read6 steps

Every web search you send to Google leaves a trace. Every API call to a commercial Search API adds to your bill. SearXNG solves both problems at once: a self-hosted metasearch engine that queries 280+ upstream engines and returns merged results — on your VPS, under your control, at zero per-query cost.

Contents· The problem: why commercial search APIs are not the answer1/6
  1. 01The problem: why commercial search APIs are not the answer
  2. 02What SearXNG provides out of the box
  3. 03Architecture: two containers, under 512 MB RAM
  4. 04Self-hosting SearXNG on a VPS: step by step
  5. 05Restrict access on public instances
  6. 06SearXNG as the search backbone for your AI stack

The problem: why commercial search APIs are not the answer

Building an AI agent that needs to search the web? Your options are: pay Google $5 per 1,000 queries, hit Bing's API rate limits, or use DuckDuckGo's unofficial API that breaks without notice. None of these give you full control, and all of them send your queries — and your users' queries — to third-party servers.

For development teams in Morocco and the MENA region, there's an additional friction: regional blocks, censorship, and the fact that results from a US-centric engine are often irrelevant to local searches. A self-hosted metasearch engine sidesteps all of this.

What SearXNG provides out of the box

  • 280+ upstream engines — Google, Bing, DuckDuckGo, Brave, Wikipedia, Reddit, GitHub, arXiv, YouTube, Twitter/X and hundreds more queried simultaneously.
  • Zero tracking — no cookies, no user profiling, no search history stored. Privacy by architecture: the engine sends queries to upstream services, not you.
  • JSON API — add ?format=json to any query and get machine-readable results. Natively supported by Open WebUI, n8n, Flowise, LangChain and CrewAI.
  • Redis caching — shared result cache reduces upstream load; rate-limiting prevents abuse on public instances.
  • AGPL-3.0 — 33 k+ GitHub stars, rolling releases, Docker image updated weekly.

Architecture: two containers, under 512 MB RAM

SearXNG runs as two Docker containers: the Python engine itself (under 256 MB RAM) and a Redis instance (~30 MB) for caching and rate-limiting. No database, no persistent state beyond the Redis cache. On a 1 GB ServOrbit VPS, SearXNG leaves plenty of room for Nginx and the OS — a 2 GB VPS is comfortable for teams with multiple concurrent users or heavy AI agent traffic.

Self-hosting SearXNG on a VPS: step by step

  1. Order a VPS

    Choose a ServOrbit Cloud VPS with at least 1 GB RAM (Ubuntu 22.04). The provisioner handles Docker installation automatically.

  2. Deploy from the marketplace

    Select SearXNG in the marketplace. The provisioner starts two containers — the SearXNG engine and Redis — and generates a secret key displayed in your client area. The web interface is available immediately on port 8080.

  3. Configure Nginx + SSL

    Point your domain (e.g. search.yourdomain.com) to the VPS IP in Cloudflare or your DNS provider. Then add an Nginx reverse-proxy block with SSL via Let's Encrypt: a server listening on listen 443 ssl, a server_name search.yourdomain.com, and inside location / a proxy_pass http://127.0.0.1:8080; together with proxy_set_header Host $host;.

    Update SEARXNG_BASE_URL=https://search.yourdomain.com/ and restart the container.

  4. Enable the JSON API for AI agents

    Edit /etc/searxng/settings.yml on your VPS (mounted as a Docker volume). Under the search: key, extend the formats: list so it contains both html and json.

    Restart the container with docker compose restart searxng, then test the JSON output with curl 'https://search.yourdomain.com/search?q=SearXNG&format=json' | jq '.results[0]'.

  5. Connect Open WebUI or n8n

    In Open WebUI: Settings → Web Search → Provider: SearXNG → URL: https://search.yourdomain.com. In n8n: HTTP Request node → GET https://search.yourdomain.com/search?format=json, passing your query in the q parameter. Your AI agents now have live, unfiltered, private web search.

  6. Logging in for the first time

    There is no account and no password: open the URL and you can start searching straight away. Your preferences are stored in your browser, not in an account.

Restrict access on public instances

If your SearXNG instance is publicly reachable, add HTTP Basic Auth in Nginx or set limiter: true in settings.yml (Redis is required for the limiter). For AI-agent-only use, you can disable the HTML interface entirely and only expose the JSON endpoint — edit formats to remove html and restrict direct browser access.

SearXNG as the search backbone for your AI stack

SearXNG has become the de facto web search backend for self-hosted AI stacks in 2026. Open WebUI, n8n, Flowise, LangChain, CrewAI and most LLM orchestration frameworks have native SearXNG integration. The pattern is always the same: your LLM decides it needs current information, calls your SearXNG endpoint with a query, gets back a JSON array of results with titles, URLs and snippets, and uses those to ground its response.

This eliminates three pain points in one deployment: no per-query billing, no data leakage to Google or Bing, and no rate limit surprises at 2 AM when your agent is running a research batch.

Private search, on your own server

Deploy SearXNG on a ServOrbit VPS and give your team and AI agents a private, uncensored search endpoint — no tracking, no API keys, no per-query billing.

Need help?

Browse our help center and FAQ, or reach our team — callback, WhatsApp or email. Support in French, English and Arabic.

Message us on WhatsAppopens in a new tab