Bitbucket Server

Gitpod works with public, private, or internal repositories on your own instance of Bitbucket Server v7.20 or later. Setting this up requires 2 steps.

  1. A one-time registration of the Bitbucket server instance with Gitpod.
  2. Each Gitpod user connects their account to Bitbucket server the first time they start a workspace.

Registering a Bitbucket Server

The Bitbucket Server Admin can register the Bitbucket Server in their own Gitpod account settings.

Start by creating a New Integration and entering the Provider Host Name of Bitbucket Server.

Gitpod New Git Integration form

Copy the Redirect URL from the form above.

Open your Bitbucket Server Administration settings in another browser tab, and create a new incoming link for an external application.

Bitbucket Server new OAuth2 application link

Configure the link with the required fields, including the redirect URL copied above, and choose “Projects Admin” permissions.

Bitbucket Server configure OAuth2 application link

Saving the configuration opens a settings page where you can copy the OAuth Client ID and a Client secret.

Bitbucket Server new OAuth client ID and secret

Copy the Client ID and Secret into the corresponding fields in the new Gitpod integration form, and activate the integration.

Refreshing the integration settings page should show a new Git provider connection to your Bitbucket Server in addition to the Git Integration registration below that.

Bitbucket Server integration and connection in Gitpod settings

Connecting Gitpod accounts to Bitbucket Server

Other Bitbucket Server users need to connect their own Gitpod account to their own Bitbucket Server account by starting a workspace.

To start a workspace, paste the URL of a Bitbucket Server repository into the New Workspace popup ( CtrlCmd + O ) in Gitpod, or prefix the repository URL as described in Getting started.

Open in Gitpod form

The first time you do this, you’ll be prompted to authorize with your Bitbucket Server instance.

Prompt to authorize with Bitbucket Server

The Bitbucket Server OAuth window will prompt for confirmation to access projects and repositories.

OAuth confirmation from Bitbucket Server

Once confirmed, the connection will be saved, and the workspace should open. Subsequent workspaces with repositories from the same Bitbucket Server instance should open without reconnecting.

Creating a project in Gitpod

To create a new project with a Bitbucket Server repository in Gitpod, select your Bitbucket Server instance from the list of git providers.

New project with Bitbucket Server

You should see your own repositories and those for all projects to which you have access. Use the dropdown to switch between your personal account and other projects.

New project select Bitbucket Server repo

Selecting the repository will install a webhook and enable automatic prebuilds for the project.

Was this helpful?