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.
In this article, we discussed the process to change the port on which Tomcat is running.