Change Tomcat Default Port

1. Overview

By default, Apache Tomcat runs on the port 8080. However, we can change the port if needed, mostly, when another application is already using this port.

In this short article, we’ll discuss how to change the Tomcat port.

2. Change Port

First, we need to navigate to the Conf folder inside the Tomcat root folder. Then, open the server.xml file.

In the server.xml file, we’ll find the port configuration similar to the below:

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Now, let’s change the connector port to 9090, which allows the Tomcat to run on 9090 instead of 8080:

    <Connector port="9090" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Finally, restart the Tomcat to use the new port.

3. Conclusion

In this article, we discussed the process to change the port on which Tomcat is running.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s