How to change the default port of Tomcat

By default Apache Tomcat consumes 8080 port number of Windows. As an example, I am using Tomcat 8.5 version to change the default port of, but the process of changing the port of Tomcat is the same for all versions. This 8080 port is the default port for other web application servers as well. Often, the organizations do not prefer to go with the default port to avoid conflicts with other applications.

Change Tomcat default port

If you want to change Tomcat port, here are the steps.

Steps to change the default port of Tomcat:

  1. Go to %CATALINA_HOME%\conf\ folder
    CATALINA_HOME is the folder where you have extracted Tomcat.
  2. Look for server.xml and open it in any text editor
  3. Search for connector port in the server.xml
    You will find something like below.
    <Connector port="8080" protocol="HTTP/1.1"
                   redirectPort="8443" />
  4. Change the default port from 8080 to whatever you want.
    In this example, I am changing it to 9090.
    <Connector port="8080" protocol="HTTP/1.1"
                   redirectPort="8443" />
  5. Save the file and restart Tomcat.
Change default port of Tomcat

You may want to read this: PSPad Editor awesome features from developer perspective

This is how you can change the default 8080 port of tomcat. Easy right?

These steps are specific to the Windows operating system and will not be applicable for Linux or Unix. Whenever I host any web application, I tend to change the default port of tomcat. The Apache Tomcat is an open-source web application server developed through multiple technologies like Java Servlet, JavaServer Pages, Java WebSocket, and Java Expression.
If you are a developer, then you can contribute to the development project of Tomcat. The popularity of Tomcat makes it once of the best web application server used in numerous industries starting from small scale to large scale organizations.
At the time of writing the article, the latest stable version of Apache Tomcat is Tomcat 9.0.37, and version 10 is under the Alpha testing phase.

I hope this article has provided all the support you needed. Do let us know your question, we would be glad to help.

Happy learning 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top