Change the port Bitbucket listens on
You can change the port that Bitbucket Data Center and Server listens on from the default '
7990' to a different value if another application is already running on that port.
You can use netstat to identify free ports on your machine.
To change the port Bitbucket listens on
- Navigate to your home directory.
shared/bitbucket.propertiesfile, add the
sever.portproperty (or edit it if a line for the
server.portproperty already exists), and set the value to the port number Bitbucket will run on. For example, to set to the port to
8080you would add:
Then save the file.
Restart Bitbucket so the change takes effect. See Start and stop Bitbucket.
If you are using a firewall, ensure that it is configured to allow HTTP or HTTPS traffic over the connector port you have chosen.
If you are running Bitbucket on a Linux server and want to bind to privileged ports (those below 1024, for example port 80), you will need to start Bitbucket as root to successfully bind to the port. However; we don't recommend that you start Bitbucket as root and instead do one of the following:
- Bind Bitbucket to a port over 1024 and configure a load balancer in front of the server to redirect traffic from port 80 to the higher port. Learn more about load balance configuration options
- Bind Bitbucket to a port over 1024 and configure
iptablesto redirect traffic from port 80 to the higher port
setcapto allow privileged port access for
javaprocesses. For more information, see Running Bitbucket Server on a privileged port without root