How to update the ports used by the bundled Elasticsearch

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

The bundled Elasticsearch that comes with Bitbucket uses the following ports by default:

Port number

Purpose

Remarks

7992 (TCP)

Elasticsearch HTTP interface port

This port is primarily used to receive HTTP and REST API requests from Bitbucket Server. As requests to this port are being made from the same server, this port does not need to be accessible from outside.

7993 (TCP)

Elasticsearch transport/node communication port

This port is used to connect Elasticsearch to a cluster and to enable node-to-node communication. This port cannot be blocked, as it will prevent Elasticsearch from starting - but this port does not need to be accessible from the outside, as the bundled Elasticsearch instance is not part of a cluster.

Reference: Which ports does Bitbucket Server listen on, and what are they used for?

If the Elasticsearch port values need to be changed for any reason, the procedures under the Solution section below can be followed.

Warning

Please take that if the port values are changed, they will be overwritten and reset to the default values when Bitbucket is upgraded.

Any modifications to the ports will need to be re-applied after the upgrade.

For this reason, it is recommended to keep the default Elasticsearch port values.

Environment

This Knowledgebase article only applies to Bitbucket instances that use the bundled Elasticsearch.

Solution

  1. Create a back up of the <Bitbucket home directory>/shared/search/elasticsearch.yml file

  2. Edit the <Bitbucket home directory>/shared/search/elasticsearch.yml file

  3. To change the HTTP interface port, change the value in the following line:

    1 http.port: 7992

    Changing the HTTP port would require the Elasticsearch URL to be updated with the new port value.

    This can be done either through the UI in Administration > Server settings > Search > Elasticsearch URL or through the plugin.search.elasticsearch.baseurl configuration property

  4. To change the transport/node communication port, change the value in the following line:

    1 transport.tcp.port: 7993
  5. Save the file

  6. Restart Bitbucket

Updated on April 16, 2025

Still need help?

The Atlassian Community is here for you.