Associate an existing domain with an account
Because we have stopped supporting CNAME's by July 1, 2015 you must change your custom domain URL's everywhere they are used to access your Bitbucket Cloud team, account, repositories, and any automated processes which access Bitbucket using the custom domain URL.
We've provided a set of examples to illustrate the process on this page.
Remove your custom domain
Before you remove your CNAME plan for changing the url references used to access the account and all it's repositories as shown in the following examples.
To remove your CNAME
- Do one of the following to access your team or account manage page:
- For an individual account: Click Avatar> Manage account.
- For a team: Click Teams>your team name then click Manage team.
- Click Custom domain.
- Click Remove Custom Domain.
Your Bitbucket team, account, and associated repositories will no longer be accessible using the custom domain URL.
Change all URL's to remove the custom domain
Change URL to access the account or team in Bitbucket
Removing the CNAME from your team or account will revert the URL used to access the team or account's overview and management pages.
This URL to access account or team overview pages:
Change the URL to access the repositories owned by the account or team
Removing the CNAME from your team or account will revert the URL used to access the team or account's repositories.
This URL to access repositories:
Change Git remote origin
If you used the CNAME domain when you initially set up your local repositories you will have to remove the remote origin entry for each repository and replace it so that it points to the repository in Bitbucket using: bitbucket.org/teamname/repo-name.
Check to see what your current remote is by switching to the directory containing your repository and using the
git remote -vcommand. It should reveal your default fetch and push URL's similar to the following:
Remove the origin designation using
git remote rm originas shown in the following example:
Add the path to your remote using
git remote add originas shown in the following example:
Verifiy the new remote using the
git remote -vcommand as shown in the following example:
Change Git action URL's
Git actions URL's like this:
Will have to change to this:
Change mercurial action URL's
Mercurial action URL's like this:
Will have to change to this:
The information provided below is stored for archive purposes only.
Using a CNAME with Bitbucket will result in unencrypted http:// (not the https:// which Bitbucket uses) communication between your usersand the Bitbucket website. This means passwords and other potentially sensitive data will be sent in clear text.
You can alias an custom domain to your individual or team account page on Bitbucket using a DNS CNAME (canonical name record). A CNAME record is type of resource record in the Domain Name System (DNS). The CNAME record specifies that the domain name is an alias of another domain name. This option of using a custom domain is available for all Bitbucket accounts both free and paid pricing plans.
To set up a CNAME, you must own the domain name you are aliasing. For example, the custom domain
git.coolcode.com has a domain name of
coolcode.com . To alias your account in the
bitbucket.org domain (
bitbucket.org/youraccountname ) to
coolcode.com , you must own the
The DNS specification disallows CNAME records at the root of a site. So, if you own
coolcode.com , do not associate your top level domain,
coolcode.com , with your Bitbucket account. Instead, alias a subdomain such as
How to set up a CNAME for your Bitbucket Account
To set up a CNAME, you must perform two procedures; one on your DNS hosting service and one on Bitbucket.
On your DNS hosting service
The actual steps to configure a CNAME vary depending on the DNS provider you use. You should consult the help for the service to find out the exact steps.
- Log into the domain control panel DNS administration for your domain name.
Configure the domain name you want.
In this example, the user had a DNS that required this type of configuration:
Keep in mind your DNS provider may ask you to configure this differently. For example, notice that there are no http(s) or slashes in these settings.
To avoid negative caching, create your CNAME entry before with your DNS hosting provider before proceeding.
- Log into the Bitbucket account you want to alias.
- Choose your avatar > Manage Account from the menu bar.
- Choose Custom domain from the left menu bar.
- Enter a Cname in the field provided.
In this example you enter the following:
- Click Save domain.
HTTPS and CNAMEs
Please note that accessing a Bitbucket account configured with a custom domain over HTTPS may result in security warnings from your browser.
The Bitbucket service can only serve one SSL certificate, and that certificate can only be associated with the
bitbucket.org domain. When you access a CNAME over HTTPS, your browser will see that the certificate's domain doesn't match the address you've visited and presents a warning message. For this reason, we allow non-secure HTTP access to CNAMEs. However, if you don't mind the certificate warnings and you'd prefer to access your CNAME over an encrypted session, you can still use HTTPS.
For cloning, pushing, and pulling to repositories on CNAMEs, we recommend connecting directly to bitbucket.org over HTTPS or SSH to ensure your password is transmitted securely.
Frequently Asked Questions about CNAMES
- Can I get SSL support for my customer domain?
Bitbucket doesn't support installation of custom SSL certificates on our systems. As a result, we cannot support SSL on custom domains. We recommend using the website directly via
bitbucket.orgto ensure your privacy remains protected at all times if this is a concern for you.
- Are A records supported?
No. While you may be able to point your domain at Bitbucket's current IP address, many functions will not work as expected, our IP addresses may change and support will not be able to assist.
- Are custom domains supported for repositories?
No. Not at this time. This includes Static Hosting of pages on Bitbucket. We have https://bitbucket.org/site/master/issue/2184/support-cnames-for-repositories-bb-3655 open as a feature request to support using a custom domain for all repository types.
Was this helpful?
Thanks for your feedback!