Installation
Code Search can be installed in several ways depending on your needs and infrastructure.
Prerequisites
Section titled “Prerequisites”Before installing, ensure you have:
- Docker (version 20.10+) and Docker Compose (v2)
- PostgreSQL 14+ or MySQL 8+ (or use the included Docker container)
- Redis 7+ (or use the included Docker container)
- At least 4GB RAM and 10GB disk space for small deployments
For development or building from source:
- Go 1.22+
- Node.js 20+
Installation Methods
Section titled “Installation Methods”The easiest way to get started. Run all services with a single command.
-
Download the docker-compose file:
Terminal window curl -O https://raw.githubusercontent.com/techquestsdev/code-search/main/docker-compose.yml -
Create a configuration file:
Terminal window curl -O https://raw.githubusercontent.com/techquestsdev/code-search/main/config.example.yamlmv config.example.yaml config.yaml -
Edit
config.yamlwith your settings (optional for basic usage) -
Start all services:
Terminal window docker compose up -d -
Verify everything is running:
Terminal window docker compose ps
Services will be available at:
- Web UI: http://localhost:3000
- API: http://localhost:8080
- API Docs: http://localhost:8080/docs
Build from source for development or customization.
-
Clone the repository:
Terminal window git clone https://github.com/techquestsdev/code-search.gitcd code-search -
Install Go dependencies:
Terminal window go mod tidy -
Build all binaries:
Terminal window make build -
Build the web UI:
Terminal window cd webnpm installnpm run buildcd .. -
Start infrastructure (PostgreSQL, Redis, Zoekt):
Terminal window docker compose up -d postgres redis zoekt -
Run database migrations:
Terminal window make migrate-up -
Start the services:
Terminal window # Terminal 1: API Server./bin/code-search-api# Terminal 2: Indexer./bin/code-search-indexer# Terminal 3: Web UI (development)cd web && npm run dev
Deploy to Kubernetes using Helm or raw manifests.
-
Add the Helm repository:
Terminal window helm repo add code-search https://aanogueira.github.io/code-searchhelm repo update -
Install the chart:
Terminal window helm install code-search code-search/code-search \--namespace code-search \--create-namespace \--set config.database.url="postgres://user:pass@postgres:5432/codesearch" \--set config.redis.url="redis://redis:6379" -
Port-forward to access locally:
Terminal window kubectl port-forward svc/code-search-web 3000:3000 -n code-search
See Helm Deployment for detailed configuration options.
CLI Installation
Section titled “CLI Installation”The CLI can be installed separately for interacting with a Code Search server.
# Using Homebrewbrew install aanogueira/tap/code-search
# Or download binarycurl -L https://github.com/techquestsdev/code-search/releases/latest/download/code-search-darwin-arm64 -o code-searchchmod +x code-searchsudo mv code-search /usr/local/bin/# Download binarycurl -L https://github.com/techquestsdev/code-search/releases/latest/download/code-search-linux-amd64 -o code-searchchmod +x code-searchsudo mv code-search /usr/local/bin/
# Or use Go installgo install github.com/techquestsdev/code-search/cmd/cli@latest# Download binaryInvoke-WebRequest -Uri "https://github.com/techquestsdev/code-search/releases/latest/download/code-search-windows-amd64.exe" -OutFile "code-search.exe"
# Move to PATHMove-Item code-search.exe C:\Windows\System32\# Run CLI from Dockerdocker run --rm -it ghcr.io/techquestsdev/code-search-cli:latest search "foo"
# Create an alias for conveniencealias code-search='docker run --rm -it -v ~/.code-search:/root/.code-search ghcr.io/techquestsdev/code-search-cli:latest'Verify Installation
Section titled “Verify Installation”After installation, verify everything is working:
# Check the API is respondingcurl http://localhost:8080/health# Expected: {"status":"ok"}
# Check all services are readycurl http://localhost:8080/ready# Expected: {"status":"ready","checks":{"database":"ok","redis":"ok","zoekt":"ok"}}
# Test the CLIcode-search --versionNext Steps
Section titled “Next Steps”Now that Code Search is installed:
- Quick Start - Add your first repository and start searching
- Configuration - Customize your installation
- Code Hosts - Connect to GitHub, GitLab, and more