Moving Bitbucket Server to a different context path

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

There are various reasons why you might need to change the context path for Bitbucket Data Center. Two of those are:

Solution

To change the context path:

  1. Navigate to your home directory.

  2. Stop Bitbucket. See Start and stop Bitbucket.

  3. Open the shared/bitbucket.properties file, and add the server.context-path property. Set it to reflect the context path that you want Bitbucket to be accessible at. For example, to set the context path to /bitbucket you would add:

    server.context-path=/bitbucket

    Then save the file.

  4. Start Bitbucket. See Start and stop Bitbucket. Bitbucket is now available at the same host as before, but under the new context path. For example, a server that was at http://localhost:7990 will now be reachable at http://localhost:7990/bitbucket.

  5. Once started, go to Settings > Server settings.

  6. Append the new context path to your base URL:

    https://localhost:7990/bitbucket

  7. Select Save.

Important considerations

If you're running Bitbucket behind Apache,

  • You need to make sure the host or context path that Bitbucket is exposed on is not also being used by another web application that is listening on a different port.

  • If you updated the Bitbucket context path using the steps outlined above, you also need to update your Apache configuration, as described in Integrating Bitbucket with Apache HTTP Server.

If you had Application Links set up before changing the context path in Bitbucket, you have to recreate those using the new Bitbucket URL. See Link Bitbucket with Jira.

If you use SSH, the context path does not affect the URL at which SSH operations occur. After changing the context path so that Bitbucket is accessible at https://localhost:7990/bitbucket, SSH operations occur without the context path at ssh://my-bitbucket-hostname:7999.

Related pages

Updated on June 23, 2025

Still need help?

The Atlassian Community is here for you.