Back to articles
Technology Insight

Self-Hosting a Minimalist Perplexity: A Guide to Deploying Khoj or Perplexica on a VPS with DeepSeek API

May 29, 2026

The Rise of AI Search and the Case for Self-Hosting

The landscape of information retrieval has shifted dramatically. Traditional search engines that present a list of blue links are increasingly being replaced by answer engines like Perplexity AI, which synthesize web information, cite sources, and deliver direct answers. While these commercial platforms offer incredible utility, they come with caveats: subscription costs, privacy concerns, and reliance on third-party infrastructure.

For businesses and tech-savvy professionals, there is a compelling alternative: self-hosting your own AI search engine. By combining open-source frameworks like Khoj or Perplexica with a Virtual Private Server (VPS) and the highly cost-effective DeepSeek API, you can deploy a customized, private, and powerful 'mini-Perplexity'. This guide provides a comprehensive roadmap to achieving exactly that.

Understanding the Architecture: The Trio of Self-Hosted AI Search

Before diving into configuration, it is essential to understand how the components interact to deliver a seamless search experience.

  • The Frontend & Orchestration Layer (Khoj or Perplexica): These open-source applications act as the brain of your setup. They handle the user interface, manage chat history, execute web searches via search APIs, coordinate the Retrieval-Augmented Generation (RAG) pipeline, and present the final cited answers.
  • The Compute Layer (VPS): A Virtual Private Server hosts the application. Because the heavy lifting of language model inference is outsourced to an external API, the VPS hardware requirements remain modest and highly affordable.
  • The Intelligence Layer (DeepSeek API): DeepSeek provides the Large Language Model (LLM) that processes the retrieved web pages and synthesizes them into a coherent response. DeepSeek's models offer state-of-the-art reasoning capabilities at a fraction of the cost of competing proprietary models.

Choosing Your Framework: Perplexica vs. Khoj

Both tools are excellent, but they cater to slightly different use cases. Choosing the right one depends on your specific organizational needs.

Perplexica: The Direct Perplexity Clone

Perplexica is built from the ground up to replicate the Perplexity experience. It focuses heavily on iterative web searching, deep research modes, and clean visualization of sources. It features built-in support for multiple search engines (like SearXNG, Google, or Bing) and possesses an intuitive UI optimized for web-based exploration.

Khoj: The Ultimate Personal Knowledge Assistant

Khoj goes a step beyond simple web searching. It is designed as an AI assistant for your entire digital life. In addition to searching the web, Khoj can index your local markdown files, PDFs, Github repositories, and Notion workspaces. If you want an engine that searches both the public internet and your private corporate knowledge base, Khoj is the ideal choice.

Prerequisites and System Requirements

To ensure a smooth deployment, verify that you have the following prerequisites ready:

  1. A VPS Instance: A modest server with at least 2 vCPUs, 4GB RAM, and 40GB SSD storage running Ubuntu 22.04 LTS or later. Providers like DigitalOcean, Linode, or Hetzner are perfect for this.
  2. A Domain Name: A domain or subdomain (e.g., search.yourcompany.com) pointed to your VPS IP address for secure SSL access.
  3. DeepSeek API Key: An active account on the DeepSeek platform with API credits funded.
  4. Search API Key (Optional but Recommended): An API key from a search provider such as Tavily, SearXNG, or Bing to power the web scraping capabilities.

Step-by-Step Deployment Guide via Docker

Using Docker Compose is the most efficient and reliable method to deploy these applications. Below, we outline the deployment process using Perplexica as our primary example, given its explicit focus on mimicking Perplexity.

Step 1: Connect to Your VPS and Install Docker

First, SSH into your server and update the package repository to ensure all system software is current:

ssh root@your_vps_ip
sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose -y

Step 2: Clone the Repository and Configure Environments

Clone the Perplexica repository to your server and navigate into the project directory:

git clone [https://github.com/ItzCrazyKats/Perplexica.git](https://github.com/ItzCrazyKats/Perplexica.git)
cd Perplexica

Inside the directory, you will find a configuration file or an .env.example file. Copy this to create your active environment file:

cp sample.config.toml config.toml

Edit the config.toml or .env file using a text editor like Nano to insert your specific API keys and backend settings:

nano config.toml
Crucial Configuration Note: When configuring the LLM provider, select OpenAI-compatible or explicitly DeepSeek if supported natively. Set the base URL to [https://api.deepseek.com/v1](https://api.deepseek.com/v1) and input your DeepSeek API key. For the model selection, deepseek-chat (powered by DeepSeek-V3) offers an exceptional balance of speed and intelligence.

Step 3: Launch the Containers

With your configurations securely in place, initiate the multi-container setup using Docker Compose:

sudo docker-compose up -d

This command downloads the required images for the frontend, backend, and any localized search routing components, launching them safely in detached mode in the background.

Securing Your Instance with a Reverse Proxy

Running your application over standard HTTP on an exposed port is insecure for business operations. To safeguard data transmission, implement a reverse proxy using Nginx and secure it with Let's Encrypt SSL certificates.

Install Nginx on your host VPS system:

sudo apt install nginx -y

Configure an Nginx server block directing traffic from your domain to the internal port utilized by your chosen search framework (typically port 3000 or 8000). Once configured, apply Certbot to automate SSL acquisition:

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d search.yourcompany.com

Your self-hosted search engine is now fully operational, encrypted, and accessible via a clean URL.

Optimizing Costs and Performance

One of the primary benefits of this architecture is its extreme cost efficiency. By utilizing DeepSeek instead of more expensive Western proprietary models, your operational costs drop significantly.

Cost DimensionProprietary AlternativeDeepSeek Setup
API Costs (per 1M tokens)High (~$2.50 - $10.00)Extremely Low (~$0.14 - $0.28)
Monthly Fixed CostPer-user subscription ($20/mo)Flat VPS Cost (~$5 - $12/mo)
Data Privacy ControlShared with external entitiesMaintained within your infrastructure

To further optimize the system, consider utilizing specialized search APIs like Tavily AI, which are pre-filtered for LLM consumption, reducing token waste and improving answer accuracy.

Conclusion

Building a self-hosted 'mini-Perplexity' using Khoj or Perplexica backed by the DeepSeek API represents the perfect convergence of open-source flexibility and modern AI efficiency. It empowers businesses to enjoy the productivity gains of advanced AI search engines while retaining complete authority over infrastructure, data privacy, and recurring software expenditures. As open-source AI frameworks continue to mature, the viability of self-hosting business-critical AI tooling will only strengthen.

Self-Hosting a Minimalist Perplexity: A Guide to Deploying Khoj or Perplexica on a VPS with DeepSeek API | DPTCloud