Install Sourcegraph with Docker

Prerequisites

Docker is required.

Step 1: Run Sourcegraph

docker run \
  --publish 7080:7080 --rm \
  --volume ~/.sourcegraph/config:/etc/sourcegraph \
  --volume ~/.sourcegraph/data:/var/opt/sourcegraph \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  sourcegraph/server:2.13.5

When Sourcegraph is ready, continue at http://localhost:7080.

Step 2: Add repositories

After creating an account, go to the Configuration page in the site admin area.

Click Add GitHub.com repositories to add all repositories associated with your GitHub.com account, or see how to add repositories from other code hosts.

Step 3: Start searching your code

Done! You’re ready to search your code.

Next steps

File system performance on Docker for Mac

There is a known issue in Docker for Mac that causes slower than expected file system performance on volume mounts, which impacts the performace of search and cloning.

To achieve better performance, you can do any of the following: