How to connect to BitBucket with IP restrictions

Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.

Builder content link
e.g. Builder.io: Visual Development Platform

Builder public api key
*go to Builder.io: Visual Development Platform and copy your PUBLIC api key
*
9b3ed7b8cb1c4235b5b039fcce727938

What are you trying to accomplish
I am trying to connect builder.io with our Bitbucket Cloud where we have IP restrictions. However when the IP restrictions are ON: We can see the Projects from the Connect page, but when we try to actually connect, we are presented with the following error :

Please note that the branch does exist in BitBucket.

We tried adding the following IPs in our whitelist:

34.144.239.72
34.30.72.147

But it does not work.
When we remove the IP restrictions from bitbucket it does work. But this is not possible solution for us.

Please note that BitBucket has Access Controls with the option to whitelist only IP ranges, not the URLs that you provided here:

Is there a way for you to provide us with the list of IP ranges that we need to whitelist?
Or if possiblee provide our Space with a Static IP which we can whitelist (Similar to BitBucket DataCenter)?

Screenshots or video link
Screenshots of your issue, or even better a link to a video of what is happening or what you are trying to accomplish. We love using loom for that sort of thing

Code stack you are integrating Builder with
e.g. NextJS, react, Shopify

Reproducible code example
*If you are having integration errors, please link to codesandbox or copy and paste your problematic code here. The more detail the better!
Steps to reproduce:

  1. Create a Builder.io account.
  2. Create a Bitbucker Cloud Workspace with Access Controls and setup IP restrictions.
  3. You will not be able to connect builder.io with your BitBucket Projects*

Hello @antonz,

Thanks for providing the detailed context and screenshots. The behavior you’re seeing is due to how Builder.io interacts with Bitbucket, especially when IP restrictions are enabled. Here’s the breakdown and guidance:

  1. IP Whitelisting Requirements
    • For customers hosting Bitbucket Data Center (DC) behind a firewall or VPN, all Builder.io Git requests flow through our ai-services API. In this case, your firewall must whitelist our IP:

      35.226.66.119
      
    • Bitbucket Cloud users typically don’t need a static IP, but since you have IP restrictions enabled, the IPs you currently whitelisted (34.144.239.72, 34.30.72.147) do not cover all Builder.io service requests.

  2. Branch and Repository Sensitivity
    • Bitbucket is very branch-sensitive. The default branch in your repository must exactly match the mainBranchName configured in Builder.io. Bitbucket’s default is often master, but in your case, your default branch is main, which should be reflected in Builder.io’s settings.
    • Pull Request creation will fail if the configured branch doesn’t match the repo’s default branch.
  3. Bitbucket Data Center vs Cloud
    • Bitbucket DC has no concept of a “workspace”—it only works with project/repo-name.

    • To clone a repo from Bitbucket DC, you must supply the username and token in this format:

      username@token
      

      (Note: x-token-auth style like GitLab won’t work.)

    • API payloads differ between Cloud and DC, so Builder.io sends different request bodies depending on which you are using.

  4. Getting Started if Behind VPN/Firewall
    • If your Bitbucket DC is behind a VPN or firewall, we recommend using the Builder Desktop App with local containers or Podman to connect initially. This bypasses the need for all traffic to flow publicly. You can download the desktop app here:
      Builder Desktop App
  5. Next Steps
    • Whitelist 35.226.66.119 in your Bitbucket firewall.
    • Ensure the mainBranchName in Builder.io matches your repo’s default branch.
    • Use the Builder Desktop App if you are on Bitbucket DC behind a VPN or firewall.

Once these steps are in place, Builder.io should be able to connect to your Bitbucket projects even with IP restrictions.

Thanks,

1 Like

Hi @manish-sharma It appears that adding the IP 35.226.66.119 solved the issue with listing of the Branches. It looks it is able to connect now from couple of builder.io spaces where we tried. We will do some further testing and hopefully we will be able to use the tool.

Just to clarify that we are using BitBucket Cloud with access controls, so whitelisting the needed IPs looks to be necessary for this to work.

Thank you again for your help. I will let you know once we finish our tests if we face other connectivity issues.

Best Regards,

Anton

1 Like

Hello @manish-sharma ,

The issue with the branch selection appears to be solved.

However, when we are building a new Project we are getting an error on the last step RANDOMLY!

We added some more IPs which we believe were getting blocked.
3.162.163.41
3.162.163.44
3.162.163.115
3.162.163.110
104.17.92.187
34.120.195.249

Do you know how we can address this random issue ?

Hello @antonz ,

Could you please share your project link?

Hi @manish-sharma it happened today with one of the test spaces that we have

Let me know if other details are needed

Best Regards,

Anton

Hello @antonz,

Thanks for sharing the link and screenshot. Have you added the same repository in any other project?