Install Sourcegraph with Docker
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.
- Configure your Sourcegraph instance
- Configure code intelligence
- Deploy Sourcegraph on AWS
- Deploy Sourcegraph on Google Cloud Platform
- Deploy Sourcegraph on Digital Ocean
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:
- For better clone performance, clone the repository on your host machine and then add it to Sourcegraph Server.
- Try adding the
:delegatedsuffix the data volume mount. Learn more.
- Run Sourcegraph Server on Linux, or use the Kubernetes cluster deployment option for even larger scale.