your-org.sourcegraph.com. Sourcegraph handles provisioning, upgrades, scaling, and availability so your team can focus on using the platform.
This guide covers the essential setup steps after your Cloud instance is provisioned.
If you don’t have a Cloud instance yet, visit sourcegraph.com to start a free trial. Sourcegraph will provision your instance and send you access credentials.
Connect code hosts
Sourcegraph needs access to your repositories before it can search or navigate your code. Connecting your code hosts is the most important first step. Navigate to Site Admin → Manage code hosts → Add code host and select your provider.GitHub
GitHub
Sourcegraph supports GitHub.com and GitHub Enterprise Server.Recommended: GitHub AppThe GitHub App integration provides the most complete access and is the recommended setup for teams:
- Select GitHub as the code host type
- Follow the prompts to install the Sourcegraph GitHub App into your GitHub organization
- Choose which repositories to sync: all repositories, selected repositories, or repositories matching a naming pattern
repo, read:org, user:email. Enter the token in the code host configuration form.For detailed configuration options and advanced settings, see the admin config docs.GitLab
GitLab
Sourcegraph supports GitLab.com and self-managed GitLab instances.
- Select GitLab as the code host type
- Enter your GitLab instance URL (use
https://gitlab.comfor GitLab.com) - Create a GitLab personal access token with
read_apiandread_repositoryscopes and enter it in the configuration form - Specify which groups or projects to sync
Bitbucket Cloud
Bitbucket Cloud
- Select Bitbucket Cloud as the code host type
- Enter your Bitbucket workspace name
- Provide an app password with
Repositories: ReadandAccount: Readpermissions - Configure which repositories to sync
Bitbucket Server / Data Center
Bitbucket Server / Data Center
- Select Bitbucket Server as the code host type
- Enter your Bitbucket Server URL
- Provide a personal access token or username/password credentials
- Configure which repositories to sync
Other Git hosts
Other Git hosts
You can connect any Git-based code host using a generic Git URL configuration. This works with self-hosted Gitea, Azure DevOps, AWS CodeCommit, and any other Git server.For instructions, see the admin config docs.
Set up authentication (SSO)
By default, Sourcegraph allows users to create accounts with a username and password. For teams, configuring single sign-on (SSO) is strongly recommended so that:- Users can sign in with their existing corporate identity
- Access is automatically revoked when an employee leaves
- You don’t need to manage passwords separately
SAML
Integrate with Okta, Azure AD, OneLogin, PingFederate, and other SAML identity providers.
OpenID Connect
Integrate with Google Workspace, Azure AD, and any OIDC-compliant identity provider.
GitHub OAuth
Allow users to sign in with their GitHub accounts.
GitLab OAuth
Allow users to sign in with their GitLab accounts.
Invite users
Once authentication is configured, you can bring your team onto Sourcegraph.Invite individual users
- Navigate to Site Admin → Users and auth → Users
- Click + Create user
- Enter the user’s email address and username
- Click Create account
Self-service sign-up via SSO
If you’ve configured an SSO provider, users can sign in at your Sourcegraph URL and their account will be created automatically on first login. No manual invitation is needed.Manage user roles
Sourcegraph has two roles:- User — can search, navigate code, and use all developer features
- Site admin — has full access to site configuration, user management, and code host settings
Configure email
By default, a Sourcegraph Cloud instance cannot send outbound email. Email is required for:- Password reset links for non-SSO users
- Email-based user invitations
- Code monitor alert notifications
Enterprise features
Sourcegraph Cloud includes the full suite of enterprise features. Key capabilities to configure:Precise code navigation
Upload SCIP/LSIF data to enable compiler-accurate go-to-definition and find-references across 11 languages. Auto-indexing can generate this data automatically.
Code Insights
Track codebase trends over time. Build dashboards to measure migrations, adoption, and code health.
Batch Changes
Automate large-scale code changes across all connected repositories. Create and track pull requests from a single interface.
Deep Search
Ask natural language questions and get sourced, comprehensive answers from an AI agent that explores your codebase.
Cody AI
AI code assistant with context over your entire organization’s codebase. Available in VS Code, JetBrains, and the web UI.
MCP Server
Connect AI tools and IDEs to Sourcegraph via the Model Context Protocol.
Additional resources
Take the tour
See Sourcegraph features through real-world developer workflows.
Search query syntax
Learn the full Sourcegraph search query language.
Admin overview
Full reference for site administration settings and configuration.
Community and support
Join the Sourcegraph Discord community or contact support at [email protected].