Hound
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:latest4 container_name: hound5 restart: unless-stopped6 volumes: 7 - ./hound-config.json:/data/config.json8 - hound_data:/data/repos9 ports: 10 - "6080:6080"1112volumes: 13 hound_data: .env Template
.env
1# Create hound-config.json with repo list2# See github.com/hound-search/houndUsage Notes
- 1Docs: https://github.com/hound-search/hound
- 2Access at http://localhost:6080 - instant regex search
- 3Configure repos in hound-config.json (git URLs or local paths)
- 4Indexes on startup and periodically refreshes
- 5Very fast - millisecond search across large codebases
- 6Lightweight alternative to Sourcegraph
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 hound:5 image: etsy/hound:latest6 container_name: hound7 restart: unless-stopped8 volumes:9 - ./hound-config.json:/data/config.json10 - hound_data:/data/repos11 ports:12 - "6080:6080"1314volumes:15 hound_data:16EOF1718# 2. Create the .env file19cat > .env << 'EOF'20# Create hound-config.json with repo list21# See github.com/hound-search/hound22EOF2324# 3. Start the services25docker compose up -d2627# 4. View logs28docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/hound/run | bashTroubleshooting
- 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
Shortcuts: C CopyF FavoriteD Download