Note
Building from source is only required if you'd like to contribute. The recommended way to use Sourcebot is to use the pre-built docker image.
-
Install
go,
docker, and
NodeJS. Note that a NodeJS version of at least
24is required. -
Install ctags (required by zoekt)
// macOS: brew install universal-ctags // Linux: snap install universal-ctags
-
Install corepack:
npm install -g corepack
-
Install
yarn:npm install --global yarn
-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/sourcebot-dev/sourcebot.git
-
Run
maketo build zoekt and install dependencies:cd sourcebot makeThe zoekt binaries and web dependencies are placed into
binandnode_modulesrespectively.Note:
makeshould also be run whenever switching between branches to ensure all dependencies are upto date. -
Start the development Docker containers for PostgreSQL and Redis.
docker compose -f docker-compose-dev.yml up -d
-
Generate the database schema.
yarn dev:prisma:migrate:dev
-
Create a copy of
.env.developmentand name it.env.development.local. Update the required environment variables. -
If you're using a declarative configuration file, create a configuration file and update the
CONFIG_PATHenvironment variable in your.env.development.localfile. -
Start Sourcebot with the command:
yarn dev
A
.sourcebotdirectory will be created and zoekt will begin to index the repositories found in theconfig.jsonfile. -
Start searching at
http://localhost:3000.