Skip to main content
Sourcegraph Cloud provides a single-tenant, fully managed instance hosted and operated by Sourcegraph. Your instance runs on dedicated infrastructure at a URL like 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.
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:
  1. Select GitHub as the code host type
  2. Follow the prompts to install the Sourcegraph GitHub App into your GitHub organization
  3. Choose which repositories to sync: all repositories, selected repositories, or repositories matching a naming pattern
Alternative: Personal access tokenIf you prefer to use a token, create a GitHub personal access token with the following scopes: 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.
Sourcegraph supports GitLab.com and self-managed GitLab instances.
  1. Select GitLab as the code host type
  2. Enter your GitLab instance URL (use https://gitlab.com for GitLab.com)
  3. Create a GitLab personal access token with read_api and read_repository scopes and enter it in the configuration form
  4. Specify which groups or projects to sync
For detailed configuration options and advanced settings, see the admin config docs.
  1. Select Bitbucket Cloud as the code host type
  2. Enter your Bitbucket workspace name
  3. Provide an app password with Repositories: Read and Account: Read permissions
  4. Configure which repositories to sync
For detailed configuration options, see the admin config docs.
  1. Select Bitbucket Server as the code host type
  2. Enter your Bitbucket Server URL
  3. Provide a personal access token or username/password credentials
  4. Configure which repositories to sync
For detailed configuration options, see the admin config docs.
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.
You can connect multiple code hosts to the same Sourcegraph instance. All repositories across all connected hosts are searchable simultaneously.
After adding a code host, Sourcegraph begins cloning and indexing your repositories. Monitor sync progress at Site Admin → Repositories. Indexing time depends on the number and size of repositories.

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
Sourcegraph supports the following authentication providers:

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.
Configure your authentication provider at Site Admin → Site configuration or see the authentication documentation for full setup instructions.
If you do not have the required permissions or role to configure SSO yourself, create a second admin account for a team member who does, then have them complete the SSO setup. Navigate to Site Admin → Users and auth → Users → + Create user and assign them the site-admin role.

Invite users

Once authentication is configured, you can bring your team onto Sourcegraph.

Invite individual users

  1. Navigate to Site Admin → Users and auth → Users
  2. Click + Create user
  3. Enter the user’s email address and username
  4. Click Create account
Sourcegraph will send an invitation email with a link to set their password (requires email configuration — see below).

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
Assign the site admin role at Site Admin → Users and auth → Users by clicking on a user and toggling the admin toggle.

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
To enable email, configure an SMTP server at Site Admin → Site configuration. Add the following to your site configuration JSON:
{
  "email.smtp": {
    "host": "smtp.example.com",
    "port": 587,
    "username": "[email protected]",
    "password": "your-smtp-password",
    "authentication": "PLAIN"
  },
  "email.address": "[email protected]"
}
You can use any SMTP provider: Amazon SES, SendGrid, Mailgun, Google Workspace, or your own mail server. See the email configuration docs for all options.

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].

Build docs developers (and LLMs) love