Tomcat
Tomcat Version
Server Management
Web Server
Java

How to check the Tomcat version on Linux (and Windows)

Codemia Knowledge Hub ·

Run $CATALINA_HOME/bin/version.sh (or version.bat on Windows) to print the Tomcat version, build date and JVM details in one command. If you lack shell access, need the version of a running server, or want it from code, use the Manager app, the JAR manifest, or ServerInfo instead.

Method 1: version.sh or version.bat

This works on any Tomcat installation where you have shell access.

On Unix, Linux or macOS:

bash
$CATALINA_HOME/bin/version.sh

On Windows:

cmd
%CATALINA_HOME%\bin\version.bat

Typical output:

 
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, find the install directory. Common locations are /opt/tomcat, /usr/share/tomcat and /usr/local/tomcat. For package-managed installs:

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's Manager app shows the version alongside deployed applications.

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

If Manager access is not set up, 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 scripts and monitoring tools, there is a status endpoint:

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

It returns an HTML page with the version in the title. For machine-readable output, use the text endpoint. It needs a user with the manager-script role, and Tomcat recommends keeping that role off users that have manager-gui:

bash
curl -u script-user:script-password http://localhost:8080/manager/text/serverinfo

Method 3: MANIFEST.MF and ServerInfo.properties

Tomcat's JAR manifests carry version metadata, which helps when the server is not running or when you need to check a specific library.

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 read the server info properties file packaged inside catalina.jar:

bash
unzip -p $CATALINA_HOME/lib/catalina.jar org/apache/catalina/util/ServerInfo.properties

It 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: From Java code

To check the version at runtime inside 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, ServletContext also returns the server info:

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 on any servlet container, so it suits applications that may run on Tomcat, Jetty or others.

Method 5: Docker or process inspection

In containers, the version is usually in 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

With only process-level access, look at 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

Tomcat versions and the specs they support

The version determines which security patches, Servlet API version and Java compatibility you have:

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

An outdated minor version within a major line is missing security fixes. Apache publishes CVEs against specific version ranges, so your exact version is the starting point for any vulnerability assessment.

Why a version check can mislead

  • CATALINA_HOME not set. version.sh relies on this variable and fails silently or prints an error without it. Set it, or run the script from the Tomcat installation directory.
  • Manager app not configured. Tomcat ships with no Manager users, so without a manager-gui user the Manager endpoint returns 401 or 403.
  • Installed vs running version. With several Tomcat installations on one machine, version.sh reports the one you point it at, which may not be the one serving traffic. Cross-check with the running process.
  • No catalina.jar manifest in embedded Tomcat. Repackaged or embedded distributions (such as Spring Boot's embedded Tomcat) may not include the catalina.jar manifest. Check the dependency version in your build tool instead.
  • Trusting the Server header. The server attribute in server.xml can suppress or change the Server HTTP response header, so do not rely on it to identify the version.

Course
Beginner
27 lessons
10 hours
System Design Fundamentals

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

View the course
System Design practice on Codemia

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

Practice system design