Scaling Intelligence: Deploying a Private AI Search Engine with Perplexica and SearXNG on a Budget VPS
Introduction: The Shift Toward Private AI Search
In the rapidly evolving landscape of Artificial Intelligence, search is undergoing a fundamental transformation. Traditional search engines are being replaced by AI-driven discovery engines that synthesize information rather than merely listing links. While tools like Perplexity AI have set the gold standard for this experience, they often come with concerns regarding data privacy, recurring subscription costs, and limited control over the underlying search stack.
For the privacy-conscious professional or the enterprise looking to protect internal queries, the solution lies in Self-Hosting. By combining Perplexica—an open-source AI search engine—with SearXNG as a local metasearch provider, you can create a 'Private Perplexity' environment. Remarkably, with recent optimizations in containerization and lightweight LLM APIs, this entire stack can be deployed on a modest $5 per month VPS.
The Architecture: Why Perplexica and SearXNG?
To understand why this combination is potent, we must look at the two pillars of the system:
- Perplexica: This is the 'brain' of the operation. It acts as the UI and the logic layer that takes a user query, decides what to search for, and uses a Large Language Model (LLM) to summarize the findings. It mimics the Perplexity experience by offering focused search modes (Academic, YouTube, Reddit, etc.).
- SearXNG: This serves as the 'eyes.' SearXNG is a privacy-respecting metasearch engine that aggregates results from dozens of search engines (Google, Bing, DuckDuckGo) without tracking users. By hosting it locally, Perplexica can pull real-time data without relying on expensive, third-party Search APIs.
The Economic Advantage of the $5 VPS
Historically, hosting AI required massive GPU clusters. However, by using a decoupled approach—hosting the search logic and UI on your VPS while connecting to external inference providers via API (like Groq, Together AI, or Ollama)—you can maintain a high-performance system on a machine with as little as 2GB of RAM. This setup ensures your data remains private while your compute costs stay negligible.
Step-by-Step Deployment Guide
Deploying this stack requires a basic understanding of the terminal and Docker. Follow these steps to initialize your private search engine.
1. Preparing the Environment
First, ensure your VPS is updated and has Docker installed. A standard Ubuntu 22.04 or 24.04 LTS instance is recommended. Access your server via SSH and run:
sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose -y
2. Deploying SearXNG
SearXNG will act as our local data provider. It is crucial to configure it to output JSON so that Perplexica can interpret the search results. Create a directory for your project and a docker-compose.yml file. Ensure your SearXNG settings file (settings.yml) has the formats: [json] enabled under the search section.
3. Installing Perplexica
Clone the official Perplexica repository. The system utilizes a frontend (built with Next.js) and a backend (Node.js). You will need to configure the config.toml file to point to your SearXNG instance. This creates a local loopback where Perplexica queries SearXNG over the internal Docker network, ensuring no search data leaves your server unencrypted.
4. Integrating the LLM Provider
To keep the VPS costs at $5, we recommend using an API-based LLM. Models like Llama 3 or Mixtral via Groq provide near-instant response times. In the Perplexica settings UI, you will enter your API key and select your preferred model. This hybrid approach gives you the power of a 70B parameter model without the need for a $100/month GPU server.
Optimizing for Performance and Security
Running a complex stack on a $5 VPS requires fine-tuning. Here are several professional recommendations to ensure stability:
Swap Space Configuration
A $5 VPS typically offers 1GB to 2GB of RAM. Docker containers can be memory-intensive. It is highly recommended to create a 4GB Swap file to prevent the system from crashing during heavy indexing tasks.
Reverse Proxy and SSL
Never expose your search engine directly to the internet via raw IP. Use Nginx Proxy Manager or Caddy to handle SSL encryption. This ensures that the queries you send from your browser to your VPS are protected by HTTPS, maintaining the 'Private' in Private Perplexity.
The Privacy Verdict: Is it Truly Secure?
When you use commercial AI tools, your queries are often used to train future models. By hosting Perplexica and SearXNG locally:
- No Search Tracking: SearXNG strips tracking IDs and uses its own IP to query Google/Bing, masking your identity.
- No Query Storage: Since you own the database (if any) and the logs, you control exactly how long search history is retained.
- Isolated Environment: Your internal research or proprietary business queries never touch the public logs of a major search corporation.
Conclusion: Taking Control of Your AI Journey
Building a 'Private Perplexity' is more than a technical exercise; it is a statement of digital independence. By spending the time to configure Perplexica and SearXNG on a budget VPS, you gain a tool that is as powerful as industry-leading solutions but entirely under your jurisdiction. You get the speed of AI, the depth of the live web, and the security of a private server.
As AI continues to integrate into our professional workflows, the ability to audit and control our tools will become a competitive advantage. Start small, experiment with different LLM backends, and enjoy the peace of mind that comes with a truly private search experience.
