Building and Starting Zoekt
This document provides a step-by-step guide on building and starting the Zoekt project.
Using go build
Clone the repository:
git clone https://github.com/sourcegraph/zoekt.git cd zoektBuild the project:
go buildThis command builds the Zoekt executable. The resulting binary will be named
zoektand placed in the current directory.Run the Zoekt server:
./zoekt -http :8080 -data /path/to/index/directory -ui /path/to/ui/directory- Replace
/path/to/index/directorywith the actual path to the directory where you want to store the index. - Replace
/path/to/ui/directorywith the actual path to the directory where you want to store the UI. - The
-http :8080flag specifies the port the server will listen on. You can change this to a different port if desired.
- Replace
Using Docker
Build the Docker image:
docker build -t zoekt .Run the Docker container:
docker run -d -p 8080:8080 -v /path/to/index/directory:/data -v /path/to/ui/directory:/ui zoekt- Replace
/path/to/index/directorywith the actual path to the directory where you want to store the index. - Replace
/path/to/ui/directorywith the actual path to the directory where you want to store the UI.
- Replace
Using Nix
Install Nix:
curl -L https://nixos.org/nix/install | shBuild the project:
nix-buildThis command builds the Zoekt project using Nix.
Run the Zoekt server:
./result/bin/zoekt -http :8080 -data /path/to/index/directory -ui /path/to/ui/directory- Replace
/path/to/index/directorywith the actual path to the directory where you want to store the index. - Replace
/path/to/ui/directorywith the actual path to the directory where you want to store the UI. - The
-http :8080flag specifies the port the server will listen on. You can change this to a different port if desired.
- Replace
This guide covers the basic steps of building and starting Zoekt. For more advanced usage, please refer to the official documentation.