Sourcegraph documentation
Sourcegraph is a web-based, self-hosted code search and navigation tool for developers, used by Uber, Lyft, Yelp, and more.
Sourcegraph development is open source at github.com/sourcegraph/sourcegraph. Need help? Use the issue tracker.
Quickstart guide
It takes less than 5 minutes to run and install Sourcegraph using Docker:
docker run --publish 7080:7080 --publish 127.0.0.1:3370:3370 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:3.24.1
Once the server is ready (logo is displayed in the terminal), navigate to the hostname or IP address on port 7080
. Create the admin account, then you'll be guided through setting up Sourcegraph for code searching and navigation.
For next steps and further configuration options, visit the site administration documentation.
Failed to setup nginx:failed to generate nginx configuration to /etc/sourcegraph: open /etc/sourcegraph/nginx.conf: permission denied
.
To fix this, run:
mkdir -p ~/.sourcegraph/config ~/.sourcegraph/data && chcon -R -t svirt_sandbox_file_t ~/.sourcegraph/config ~/.sourcegraph/data
Upgrading Sourcegraph
All you need to do to upgrade Sourcegraph is to restart your Docker server with a new image tag.
We actively maintain the two most recent monthly releases of Sourcegraph.
Upgrades should happen across consecutive minor versions of Sourcegraph. For example, if you are running Sourcegraph 3.1 and want to upgrade to 3.3, you should upgrade to 3.2 and then 3.3.
The Docker server image tags follow SemVer semantics, so version
3.24.1
can be found atsourcegraph/server:3.24.1
. You can see the full list of tags on our Docker Hub page.
Core documentation
- Install or update Sourcegraph
- Using Sourcegraph
- Administration
- Extensions
Features and tutorials
- Tour: A walkthrough of Sourcegraph's features, with real-world example use cases.
- How to run a Sourcegraph trial at your company
- Integrations with GitHub, GitLab, Bitbucket, etc.
- Chrome and Firefox browser extensions
- Query syntax reference
- GraphQL API
Sourcegraph subscriptions
You can use Sourcegraph in 2 ways:
- Self-hosted: Deploy and manage your own Sourcegraph instance.
- Sourcegraph Cloud: For public code only. No signup or installation required.
For self-hosted Sourcegraph instances, you run a Docker image or Kubernetes cluster on-premises or on your preferred cloud provider. There are 3 tiers: Core, Team, and Enterprise. Team and Enterprise features require a Sourcegraph subscription.