Tomcat
Tomcat Version
Server Management
Web Server
Java

Tomcat How to find out running Tomcat version?

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

The fastest way to find your running Tomcat version is to execute $CATALINA_HOME/bin/version.sh (or version.bat on Windows). This prints the exact version string, build date, and JVM details in a single command. Beyond the command line, there are several other methods available depending on whether you have shell access, a running Manager app, or need to check the version programmatically from within your application.

Method 1: The version.sh / version.bat Script

This is the most direct approach and works on any Tomcat installation where you have shell access.

On Unix/Linux/macOS:

bash
$CATALINA_HOME/bin/version.sh

On Windows:

cmd
%CATALINA_HOME%\bin\version.bat

Typical output looks like this:

 
1Server version: Apache Tomcat/9.0.85
2Server built:   Jan 3 2024 15:45:00 UTC
3Server number:  9.0.85.0
4OS Name:        Linux
5OS Version:     5.15.0-91-generic
6Architecture:   amd64
7JVM Version:    17.0.9+9-Ubuntu-122.04
8JVM Vendor:     Ubuntu

If CATALINA_HOME is not set, you can find it by checking where Tomcat is installed. Common locations include /opt/tomcat, /usr/share/tomcat, or /usr/local/tomcat. On systems managed by a package manager, check with:

bash
1# Debian/Ubuntu
2dpkg -L tomcat9 | grep version.sh
3
4# RHEL/CentOS
5rpm -ql tomcat | grep version.sh

Method 2: The Manager Web Application

Tomcat ships with a web-based Manager application that displays version information alongside deployed applications.

  1. Open http://your-server:8080/manager/html in a browser
  2. Log in with a user that has the manager-gui role
  3. The top of the page displays the server version and JVM information

If you have not configured Manager access, add a user in $CATALINA_HOME/conf/tomcat-users.xml:

xml
1<tomcat-users>
2  <role rolename="manager-gui"/>
3  <user username="admin" password="secure-password" roles="manager-gui"/>
4</tomcat-users>

For the text-based status endpoint (useful for scripts and monitoring tools):

bash
curl -u admin:secure-password http://localhost:8080/manager/status

This returns an HTML page with the version in the title. For machine-readable output, use the text endpoint:

bash
curl -u admin:secure-password http://localhost:8080/manager/text/serverinfo

Method 3: Reading the MANIFEST.MF File

Every Tomcat distribution includes version metadata in the JAR manifest files. This is useful when the server is not running or when you need to verify the version of specific libraries.

bash
# Extract version from catalina.jar
unzip -p $CATALINA_HOME/lib/catalina.jar META-INF/MANIFEST.MF | grep Implementation-Version

Expected output:

 
Implementation-Version: 9.0.85

You can also check the server info properties file directly:

bash
cat $CATALINA_HOME/lib/org/apache/catalina/util/ServerInfo.properties

This file contains:

properties
server.info=Apache Tomcat/9.0.85
server.number=9.0.85.0
server.built=Jan 3 2024 15:45:00 UTC

Method 4: Programmatic Access from Java

When you need to check the version at runtime from within a deployed application, use the ServerInfo utility class:

java
1import org.apache.catalina.util.ServerInfo;
2
3public class TomcatVersionCheck {
4    public static void main(String[] args) {
5        System.out.println("Server info: " + ServerInfo.getServerInfo());
6        System.out.println("Server number: " + ServerInfo.getServerNumber());
7        System.out.println("Server built: " + ServerInfo.getServerBuilt());
8    }
9}

From a servlet context, you can also retrieve the version through the ServletContext:

java
1import javax.servlet.ServletContext;
2import javax.servlet.http.HttpServlet;
3
4public class VersionServlet extends HttpServlet {
5    @Override
6    public void init() {
7        ServletContext ctx = getServletContext();
8        String serverInfo = ctx.getServerInfo();
9        System.out.println("Running on: " + serverInfo);
10    }
11}

This works regardless of the container, making it useful for applications that may run on Tomcat, Jetty, or other servlet containers.

Method 5: Check via Docker or Process Inspection

In containerized environments, the Tomcat version is usually part of the image tag:

bash
1docker inspect --format='{{.Config.Image}}' container-name
2# Output: tomcat:9.0.85-jdk17
3
4# Or check from inside the container
5docker exec container-name /usr/local/tomcat/bin/version.sh

If you only have process-level access, check the classpath or command-line arguments:

bash
ps aux | grep catalina
# Look for -Dcatalina.home or the path to bootstrap.jar

Comparison of Methods

MethodRequires Running ServerShell Access NeededOutput DetailBest For
version.sh / version.batNoYesFull (version, JVM, OS)Quick command-line check
Manager ApplicationYesNo (browser)ModerateRemote servers with Manager enabled
MANIFEST.MF / ServerInfo.propertiesNoYesVersion string onlyOffline verification, CI pipelines
Programmatic (ServerInfo)YesNoFullRuntime checks within applications
Docker / process inspectionDependsVariesImage tag or classpathContainerized deployments

Why Knowing the Version Matters

Tomcat versions determine which security patches, servlet API versions, and Java compatibility you have. The mapping between Tomcat major versions and specifications is worth knowing:

Tomcat VersionServlet SpecJSP SpecJava Minimum
10.1.x6.03.1Java 11
10.0.x5.03.0Java 8
9.0.x4.02.3Java 8
8.5.x3.12.3Java 7

Running an outdated minor version within a major line means missing security fixes. Apache publishes CVEs tied to specific version ranges, so knowing your exact version is the first step in any vulnerability assessment.

Common Pitfalls

  • CATALINA_HOME not set. The version.sh script depends on this variable. If it is not exported, the script fails silently or prints an error. Set it explicitly or navigate to the Tomcat installation directory before running the script.
  • Manager app not configured. By default, Tomcat ships with no Manager users. Without adding a user with the manager-gui role, the Manager endpoint returns a 401 or 403.
  • Confusing the installed version with the running version. If multiple Tomcat installations exist on the same machine, version.sh reports the version of the installation you point it at, not necessarily the one currently serving traffic. Cross-reference with the running process.
  • INFORMATION_SCHEMA confusion with MANIFEST.MF. The catalina.jar manifest may not exist in repackaged or embedded distributions (like Spring Boot's embedded Tomcat). For embedded Tomcat, check the dependency version in your build tool instead.
  • Relying on the server header. Tomcat can be configured to suppress or customize the Server HTTP response header via the server attribute in server.xml. Do not depend on it for version identification.

Summary

  • Run $CATALINA_HOME/bin/version.sh for the fastest command-line version check.
  • Use the Manager application at /manager/text/serverinfo for remote or scripted checks.
  • Read MANIFEST.MF or ServerInfo.properties when the server is not running.
  • Use ServerInfo.getServerInfo() for programmatic runtime version detection.
  • Always verify the running instance's version, not just the installed files, especially when multiple Tomcat installations coexist.
  • Keep your Tomcat version current within its major line to stay ahead of published CVEs.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.