docker.recipes

Hound

intermediate

Lightning fast code search engine.

Overview

Hound is an ultra-fast code search engine originally developed by Etsy to provide lightning-quick regex searches across massive codebases. Built in Go, Hound creates inverted indexes of your source code repositories, enabling millisecond search responses even when searching through millions of lines of code. Unlike traditional grep-based tools that scan files linearly, Hound pre-processes and indexes code to deliver instantaneous results through a clean web interface. This Docker deployment combines the Hound search engine with persistent volume storage for repository data and indexed content. The stack automatically clones configured repositories, builds searchable indexes, and maintains them through periodic updates. The containerized approach eliminates complex dependency management while providing a centralized search platform that can index both remote Git repositories and local codebases mounted as volumes. Development teams managing multiple repositories, code reviewers needing rapid cross-project searches, and organizations requiring fast code discovery will find this deployment invaluable. The combination of Hound's indexing speed with Docker's portability creates a powerful search appliance that can be deployed anywhere from developer laptops to enterprise infrastructure, providing consistent search performance without the overhead of heavyweight code analysis platforms.

Key Features

  • Real-time regex search with millisecond response times across indexed codebases
  • Automatic repository cloning and indexing from Git URLs or local filesystem paths
  • Periodic repository synchronization to keep search indexes current with latest commits
  • Web-based interface with syntax highlighting and contextual code preview
  • Support for multiple repository backends including GitHub, GitLab, and local Git repositories
  • Memory-efficient inverted indexing that scales to repositories with millions of lines
  • RESTful API endpoints for programmatic search integration with development tools
  • Configurable file type filtering and repository-specific search scoping

Common Use Cases

  • 1Multi-repository code search for microservices architectures with dozens of related services
  • 2Security auditing to quickly locate potential vulnerabilities across entire codebases
  • 3Code review assistance for finding similar implementations or usage patterns
  • 4Legacy code exploration when onboarding developers to unfamiliar systems
  • 5API usage discovery to understand how internal libraries are consumed across projects
  • 6Compliance scanning for deprecated functions or security-sensitive code patterns
  • 7Developer productivity enhancement for large monorepos where IDE search is insufficient

Prerequisites

  • Minimum 2GB RAM for indexing medium-sized repositories (scales with codebase size)
  • Port 6080 available for web interface access
  • Git access credentials for private repositories configured in hound-config.json
  • Sufficient disk space for repository clones and search indexes (typically 2-3x repository size)
  • Basic JSON knowledge for configuring repository sources and search options
  • Network connectivity to Git hosting services if indexing remote repositories

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 hound:
3 image: etsy/hound:latest
4 container_name: hound
5 restart: unless-stopped
6 volumes:
7 - ./hound-config.json:/data/config.json
8 - hound_data:/data/repos
9 ports:
10 - "6080:6080"
11
12volumes:
13 hound_data:

.env Template

.env
1# Create hound-config.json with repo list
2# See github.com/hound-search/hound

Usage Notes

  1. 1Docs: https://github.com/hound-search/hound
  2. 2Access at http://localhost:6080 - instant regex search
  3. 3Configure repos in hound-config.json (git URLs or local paths)
  4. 4Indexes on startup and periodically refreshes
  5. 5Very fast - millisecond search across large codebases
  6. 6Lightweight alternative to Sourcegraph

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 hound:
5 image: etsy/hound:latest
6 container_name: hound
7 restart: unless-stopped
8 volumes:
9 - ./hound-config.json:/data/config.json
10 - hound_data:/data/repos
11 ports:
12 - "6080:6080"
13
14volumes:
15 hound_data:
16EOF
17
18# 2. Create the .env file
19cat > .env << 'EOF'
20# Create hound-config.json with repo list
21# See github.com/hound-search/hound
22EOF
23
24# 3. Start the services
25docker compose up -d
26
27# 4. View logs
28docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/hound/run | bash

Troubleshooting

  • Repository clone failed: Verify Git URLs are accessible and authentication credentials are properly configured in config.json
  • Search returns no results after indexing: Check file type exclusions in configuration and ensure target files aren't filtered out
  • High memory usage during indexing: Reduce concurrent repository indexing or increase container memory limits for large codebases
  • Periodic updates not working: Confirm repository polling intervals in config and check Git remote access permissions
  • Web interface shows 'Index not found': Wait for initial indexing to complete or check container logs for indexing errors
  • Slow search performance: Verify indexes completed successfully and consider excluding binary files or large data files from indexing

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space