How to Change Tomcat Port Number?

Here you learn how to change tomcat port number.

The default port number of tomcat is 8080. If the port number assigned to tomcat is used by any other application then you can’t run tomcat on that port. In that situation the only solution is to change tomcat default port number. There are two ways to achieve this that I have mentioned below.

How to Change Tomcat Port Number?

Method 1: Tomcat Installation Directory

1. Go to conf folder in tomcat installation directory. Most probably you can find it inside C:/Program Files/Apache Software Foundation/Tomcat/conf

2. Now open server.xml with any text editor like notepad.

3. Look for following lines inside the file.

4. Change the port number inside Connector port=”8080″ to whatever value you want and then save the file.

5. Now tomcat will run on new port number.

Note: Sometimes you might get Access Denied error when you will save the server.xml file after editing. In that case just cut the file from conf folder and paste it somewhere else like desktop or any other directory. Now edit and save the file and paste it back in conf folder in tomcat installation directory.