Tomcat on a Different Port

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

Welcome to this hands-on lab, where we’ll change the default port used by Apache’s Tomcat, a Java-based application platform built around deploying and managing Java Web Applications. The server provided in this lab environment is Red Hat Enterprise 8 and has Tomcat 9 pre-installed for you. The Tomcat instance is currently available for you on port **8080**, on the provided server.

You will log into the server and change the port used to be **8081**.

Once you have completed the task you will need to test the new port works by connecting to it with a web browser.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Test to Ensure You Can Access the Preconfigured Tomcat Instance, Using the Server’s Public IP Address and Port 8080

It may take from 3 to 10 minutes after the hands-on lab has started before you can access the Tomcat server on Port 8080.

To access the server, copy the external IP address and test in your browser by using this IP address and appending the :8080 to it.

For example, if the IP address shown was then you would put the following into your web browser:
Log into the Server’s Console and Change the Port to 8081

Note: Tomcat is installed under /usr/local/tomcat9

You will log into the server’s console (not the web GUI) and make the changes required for changing the port to 8081.

The file you need to edit is /usr/local/tomcat9/conf/server.xml.

Find the following portion:


Then replace it with the following:


Save the file and exit.

Restart the Tomcat Server and Check for Any Errors

Restart the Tomcat server. This can be done with the following command:

systemctl restart tomcat
Connect to the Tomcat GUI via the New Port

Use a web browser and connect to your server on port 8081. If your server IP address was, then you would use the following (Note: Your IP address will likely be different):

You should now see the Tomcat GUI. This shows your change was successful.

Additional Resources

Your manager wants to use other software on your servers that use port 8080. Since that is the default port for Tomcat, you have been asked to set up a test system that uses a different port. The server is already configured, but you have been tasked with doing what is required to get it up and running on port 8081.

Perform the tasks as mentioned in the tasks list.

A successful hands-on lab will have you able to see the Tomcat GUI on the server via the new port of 8081.

Note: It may take 3 to 10 minutes after the hands-on lab has started before you are able to log into the server. This is fine and will not affect the performance of the tasks for the hands-on lab.

Logging In

Use the credentials provided on the hands-on lab overview page, and log in to the provided server as cloud_user. Note that this is for connecting to the server, not the Tomcat GUI.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?