homelabprivacyai

Build Hister: Your Own Private Search Engine

🤖 Researched and drafted automatically from the official docs, and reviewed before publishing. Commands are taken from the source projects — but always sanity-check before running anything on your own hardware.

Hister is a local search engine that indexes files and browser history on your machine. Unlike Google, DuckDuckGo, or any cloud search, Hister runs entirely on your hardware—your search queries never leave your network, and you own the index.

This guide walks you through building and running Hister as a self-hosted service on your homelab.

Prerequisites

You’ll need:

  • A Linux machine or container (x86-64 or ARM)
  • Rust toolchain installed, or Docker
  • Basic familiarity with the command line
  • A browser you want to index (currently supports Firefox and Chrome)

Step 1: Clone and Build Hister

Hister is written in Rust. You can build from source or use Docker.

Option A: Build from Source

git clone https://github.com/jmacdonald/hister.git
cd hister
cargo build --release

The binary will be at target/release/hister.

Option B: Use Docker

If you prefer containerization:

git clone https://github.com/jmacdonald/hister.git
cd hister
docker build -t hister .

Step 2: Index Your Files

Hister can index directories on your filesystem. Point it at folders you want searchable:

./target/release/hister index /path/to/documents
./target/release/hister index /path/to/projects

Replace /path/to/documents and /path/to/projects with your actual directories. Hister will recursively crawl and index supported file types.

Step 3: Import Browser History

Hister can import your browser history. Export your history from Firefox or Chrome and point Hister to it. The exact import process depends on your browser; check the Hister repository for format-specific instructions.

Once you have an exported history file:

./target/release/hister import-history /path/to/history/export

Step 4: Run the Search Server

Start Hister as a local web service:

./target/release/hister serve

By default, Hister listens on 127.0.0.1:8000 (localhost only). Open your browser to http://localhost:8000 and search.

Step 5: Access Hister on Your LAN (Optional)

If you want to search from other machines on your homelab network, you’ll need to bind Hister to your LAN IP instead of localhost. Check the Hister documentation or help output for the exact flag to specify a bind address.

Important: Keep Hister behind your firewall or VPN. Never expose it to the public internet—it contains your personal files and search history.

Step 6: Automate with Systemd (Optional)

To run Hister as a service on boot:

sudo tee /etc/systemd/system/hister.service > /dev/null <<EOF
[Unit]
Description=Hister Private Search Engine
After=network.target

[Service]
Type=simple
User=your-username
WorkingDirectory=/path/to/hister
ExecStart=/path/to/hister/target/release/hister serve
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

Replace your-username and /path/to/hister with your actual user and path.

Then enable and start:

sudo systemctl daemon-reload
sudo systemctl enable hister
sudo systemctl start hister

Check status:

sudo systemctl status hister

Step 7: Keep Your Index Fresh

You’ll want to re-index periodically as files change. Add a cron job to refresh:

0 2 * * * /path/to/hister/target/release/hister index /path/to/documents >> /var/log/hister-index.log 2>&1

This re-indexes your documents directory every day at 2 AM. Adjust the schedule and paths to suit your needs.

Searching

Once running, open http://localhost:8000 in your browser. Type queries and Hister returns results from your indexed files and history. Results are instant because everything is local.

Is It Worth It?

Yes, if you:

  • Want to search your own files without uploading them anywhere
  • Care about keeping your search history private
  • Run a homelab and have the hardware
  • Need fast, local full-text search

Hister is lightweight and runs happily on modest hardware. The trade-off: you maintain the index yourself, and the UI is minimal compared to Google. But you get privacy, control, and the satisfaction of owning your own infrastructure. For a homelab, it’s a solid addition.

Related video

New self-hosted AI & homelab shorts, daily.

Subscribe on YouTube

Related guides

← All guides