Using BitBucket with repository under VPN
Asked by Robert Dexter:

We would like to use BitBucket to manage our GIT repo that is on a server that is under VPN.

Therefore is it possible to use BitBucket with a repo that's on another server and how can it access it if its under VPN? Are there some IPs we can whitelist to give BitBucket access to the repo?

Many thanks,

Robert


Answers:
author: Charlie Misonne
body: Ok I get it now.

If you want to use the [repository import](https://support.atlassian.com/bitbucket-cloud/docs/import-a-repository/) Bitbucket Cloud will need access to your server indeed.  
My first answer has the URL to the page with Atlassian's IP addresses you could whitelist.

But to be honest I would just do a {{git push \<remote_url\> --all}} to push all the branches to Bitbucket Cloud

comments: author: Robert Dexter
body: Ah Right,

Makes sense!

And if we want to keep the repo on our server then we have to install the premium version on the machine the repo is currently on?


author: Charlie Misonne
body: (Didn't mean to create a new answer, sorry!)

No premium is also Bitbucket Cloud and it can not connect with remote storage.

If you want to install Bitbucket on you own infrastructure there is only 1 option and that is Bitbucket Data Center. But it that case you'll have to manage upgrades and maintenance yourself.


author: Robert Dexter
body: Understood,

Thanks for your help.

Robert


author: Charlie Misonne
body: Hi Robert, welcome to the Atlassian Community!

I'm not sure I understand you question correctly.

You want to install your own instance of Bitbucket and via the Bitbucket user interface you want to manage a git repo that is on another server than where you would install Bitbucket?

Or do you want to do this with Bitbucket Cloud (SaaS)?

<br />

Either way: you could just store the repo in Bitbucket and pull it to your server.

The Bitbucket Cloud IP ranges are listed here: [What are the IP addresses to configure a corporate firewall?](https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/)   
And if you'd host your own instance that depends on your environment of course

comments: author: Robert Dexter
body: Hi Charlie,

Thanks for trying to answer my question :)

Basically we have our GIT Repo on one of our servers than is under a VPN and we want to manage that repo using Bitbucket cloud.

So i'm assuming that when we setup a new bitbucket repo we have to import our current repo? and if so, can that be done if it is under VPN?

Thanks for your help,

Robert


author: Charlie Misonne
body: Hi Robert,

If you want to store your current GIT repo in Bitbucket Cloud: yes you need to import the repo into Bitbucket Cloud. There is no way to use Bitbucket Cloud with "remote" storage on your own infrastructure if that's what you were wondering.

I'm not sure what you mean with "under VPN" but you have to know Bitbucket Cloud is a SaaS application on the internet. Of coruse the repositories are proteced with user authentication.  
But if you need more protection you can opt for the **premium** version and enforce 2 factor authentication or even use an IP filter. See: [Control access to your private content](https://support.atlassian.com/bitbucket-cloud/docs/control-access-to-your-private-content/)


author: Robert Dexter
body: Thanks Charlie,

Under VPN means that that machine the repo is currently on only allows access to certain IP Ranges so if I want to import it, bitbucket cloud wont be able to access it.

Which is why i asked if there were some IPs we could whitelist to allow it to access the server our repo is on at the moment?

Thanks,

Robert