Publishing a Website on Bitbucket Cloud

Static sites hosted on Bitbucket Cloud can now be accessed at <yoursitename> No action is required for static site owners beyond updating your links to point to https://<yoursitename> Please note that HTTPS is required for for your security. For information on Bitbucket Cloud repository and file size limits, see What kind of limits do you have on repository/file size?

You can use Bitbucket to host a static website. A static website contains coded HTML pages with fixed content. Websites hosted in this way have the domain in their URL, for example,

Publishing a static website on Bitbucket Cloud requires you to combine your account's name with the domain suffix. So, your account's name must be acceptable by DNS standards. Upper case characters and special characters are typically not acceptable. For example, if your account's name is happy_cat, you would need to create a new account with the name of happycat to use this feature because underscores are not allowed in DNS hostnames. Your repository name would be and the published static website is reached by this URL:

The following topics appear on this page: 

Configure a Website for Hosting

To use this feature, do the following:

  1. Log into your Bitbucket account.
    Create a repository and making sure to Name it using the following format:
    For example, if the name of the account where you're adding this repository (which can be your individual account or team name) is tutorials your repository Name should be

  2. Clone the repository to your local system.
  3. Create an index.html file in the repository root.
    Keep in mind the names are case sensitive; Bitbucket treats index.html and Index.html as different file names. Make sure your file is named index.html – all lowercase.
  4. Add index.html file to your repository, commit the change, and push the result to Bitbucket.
  5. Navigate to the site.
    For example, if your individual account or team name is tutorials you would navigate to The system displays the HTML in the site's index.html.  

Features and Limitations of this Feature

Static websites on Bitbucket support the following features:

  • Embedding images and other media. 
  • Inclusion of JavaScript in your HTML pages.
  • Blog comments by embedding Disqus in your site.

This feature turns a repository into a plain static webserver that uses the repository's root as the web root. This leads to some limitations:

  • The system does not issue cookies. 
  • Server-side scripts or code are not supported. For example, PHP is not available.
  • Each page will be cached for 15 minutes. This means your changes won't be visible immediately. You can manually refresh each page in your browser to see the latest version.

Finally, we inject a rum.js script into each Bitbucket website. This script captures internal web analytics and statistics.

Hosting Multiple Projects Under a Single Website

You may have multiple projects that you want to host from the same Bitbucket websites, you can do this by placing each project in a repository subdirectory. In this example, you would want to organize things such that you can point users to:


Each project sub-directory would act as a self-contained website with its own index.html.

Bitbucket is forgiving with regard to trailing slashes: a request to with result in projectX/index.html being served (if such a file exists), regardless of whether the trailing slash is included in the URL.

While you can use subdirectories to manage different projects each static site will generate from the main branch of the repository. Master is the default main branch, although you can change this in the repository settings. Bitbucket only generates content from the selected main branch.

Public and Private Repositories and Static Websites

The static website you create with this feature is just like any other website on the Internet — anyone with the URL (address) can visit and view your static website.  The underlying Bitbucket repository can be a public repository or a private repository.  This means if your Bitbucket repository is private, users can still visit and view the static website.  The same is true if the underlying repository is public.

Last modified on Nov 6, 2018

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.