Change listen port for Confluence

Problem

This page tells you what to do if you get errors like the following when starting Confluence, when you can't access Confluence on port 8090.

If you see this error:

java.net.BindException: Address already in use: JVM_Bind:8090

This means you are running other software on Confluence's default port of 8090. This may be another other process running on the same port. It may also be a previous instance of Confluence that hasn't been shut down cleanly.

To find out what process is listening on that port, load a command prompt and type: netstat -an

 -a : Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.
 -n : Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.

There is also Process Explorer tool available to determine what is binding port 8090.

Solution: Change the Ports which Confluence Listens On

To change the ports for Confluence, open the file conf/server.xml under your Confluence Installation directory. The first four lines of the file look like this:

Default conf/server.xml
<Server port="8000" shutdown="SHUTDOWN" debug="0">
    <Service name="Tomcat-Standalone">
        <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8090" minProcessors="5" maxProcessors="75"
            enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false"/>
        ...

You need to modify both the server port (default is 8000) and the connector port (default is 8090) to ports that are free on your machine. The server port is required by Tomcat but is not user facing in any way. The connector port is what your users will use to access Confluence, eg in the snippet above, the URL would be http://example.com:8090.


(tick) Hint: You can use netstat to identify free ports on your machine. See more information on using netstat on Windows or on Linux.

For example, here are the first four lines of a modified server.xml file, using ports '8020' and '8099':

Modified conf/server.xml using ports 8020 and 8099
<Server debug="0" shutdown="SHUTDOWN" port="8020">
    <Service name="Tomcat-Standalone">
        <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8099" minProcessors="5" maxProcessors="75"
            enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false"/>
        ...

To access Confluence in this configuration, point your web browser to http://localhost:8099/.

Final Configuration

  • If this is the URL your users will use to access Confluence, update your Base URL to point to the new URL.

  • You should also ensure at this point that if you are using a firewall, it is configured to allow http/https traffic over the port you have chosen. 
NOTES

[1] For more information on netstat, see using netstat on Windows, or netstat man page (Linux).

[2] The Jira distribution runs on port 8080 by default. If you're looking to change the port of your Jira application's distribution, see Changing JIRA application TCP ports.

[3] You will need to restart Confluence after editing server.xml for the changes to take effect.

Last modified on Feb 8, 2024

Was this helpful?

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