How Can You Check the Tomcat Version on a Linux System?

Determining the version of Apache Tomcat running on a Linux system is a fundamental task for developers, system administrators, and anyone managing web applications. Knowing the exact Tomcat version helps ensure compatibility, security, and optimal performance of your server environment. Whether you’re troubleshooting issues, planning upgrades, or simply verifying your setup, having a quick and reliable method to check the Tomcat version can save valuable time and effort.

In the world of web servers and Java-based applications, Tomcat stands out as a widely used servlet container that powers countless websites and services. Given its critical role, maintaining awareness of the version in use is essential. Different versions may introduce new features, security patches, or configuration changes that impact your deployment. Understanding how to identify the Tomcat version on a Linux machine lays the groundwork for effective server management and informed decision-making.

This article will guide you through the various approaches to quickly and accurately check the Tomcat version on Linux systems. By exploring common commands and file locations, you’ll gain practical knowledge that can be applied regardless of your Tomcat installation method. Prepare to enhance your server management skills with straightforward techniques that ensure you’re always in the know about your Tomcat environment.

Checking Tomcat Version Using Command Line

One of the most straightforward methods to determine the Tomcat version on a Linux system is by using the command line. This approach requires access to the terminal and knowledge of where Tomcat is installed. Typically, Tomcat is installed in directories such as `/usr/share/tomcat`, `/opt/tomcat`, or `/usr/local/tomcat`.

To check the version, you can use the `version.sh` script located in the `bin` directory of the Tomcat installation. Navigate to the Tomcat `bin` folder and execute the script as follows:

“`bash
cd /path/to/tomcat/bin
./version.sh
“`

This script outputs detailed information including the server version, server number, and JVM version.

If you do not have execute permissions on the script, you might need to add them first:

“`bash
chmod +x version.sh
./version.sh
“`

Alternatively, if you want to check the version without navigating to the `bin` directory, you can run the script by specifying the full path:

“`bash
/path/to/tomcat/bin/version.sh
“`

Another command to identify the Tomcat version involves running the `catalina.sh` script with the `version` argument:

“`bash
/path/to/tomcat/bin/catalina.sh version
“`

This will produce output similar to the `version.sh` script but may include additional environment details.

Inspecting Tomcat Version via Configuration Files

If executing scripts is not an option, or if you want to verify the version through file inspection, you can check certain files within the Tomcat installation directory.

  • RELEASE-NOTES or RELEASE.txt: These files are commonly present in the root Tomcat directory and contain detailed version information and release history.
  • Manifest files: The `META-INF/MANIFEST.MF` file within the `catalina.jar` or other core JAR files also includes version metadata.

To check the manifest file, use the following command:

“`bash
unzip -p /path/to/tomcat/lib/catalina.jar META-INF/MANIFEST.MF | grep “Specification-Version”
“`

This command extracts the manifest content and filters the line containing the version specification.

Similarly, you can check other core JAR files to cross-verify the version.

Using Web Interface to Determine Tomcat Version

If the Tomcat server is running and accessible via a web browser, the version can often be identified through the default web interface or status pages.

  • Access the Tomcat manager application by navigating to:

“`
http://:/manager/html
“`

  • Once logged in, the version information is usually displayed on the top right corner of the manager page.
  • If the manager application is not installed or accessible, the version might also be exposed in the HTTP response headers of the server.

For example, you can use the `curl` command to fetch headers:

“`bash
curl -I http://: “`

Look for the `Server` header which sometimes includes the Tomcat version, such as:

“`
Server: Apache-Coyote/1.1
“`

Note that for security reasons, some administrators disable or modify this header to hide version information.

Summary of Common Methods to Check Tomcat Version

Below is a table summarizing the common methods to check the Tomcat version on Linux, their commands or locations, and key considerations:

Method Command / Location Key Notes
Using version.sh script /path/to/tomcat/bin/version.sh Direct and reliable; requires execution permission
Using catalina.sh script /path/to/tomcat/bin/catalina.sh version Provides additional environment info; executable required
Checking RELEASE-NOTES file /path/to/tomcat/RELEASE-NOTES Manual inspection; file must be present
Inspecting MANIFEST.MF in catalina.jar unzip -p /path/to/tomcat/lib/catalina.jar META-INF/MANIFEST.MF Extracts version metadata from JAR file
Using Tomcat Manager Web Interface http://server-ip:port/manager/html Requires Tomcat to be running and manager app accessible
Checking HTTP Headers curl -I http://server-ip:port May show version in Server header; can be hidden

Methods to Determine the Tomcat Version on Linux

To accurately identify the version of Apache Tomcat installed on a Linux system, several reliable methods can be employed. These methods leverage command-line tools, configuration files, and Tomcat’s built-in utilities.

Before proceeding, ensure you have the necessary permissions to access the Tomcat installation directory and execute commands.

Check the Version Using the Tomcat Startup Script

The Tomcat startup script (`catalina.sh`) includes a command option to display the version information.

  • Navigate to the Tomcat `bin` directory, typically found at `/opt/tomcat/bin` or `/usr/share/tomcat/bin`:
cd /path/to/tomcat/bin
  • Run the following command to print the version details:
./catalina.sh version

This command outputs the Tomcat version along with Java version details, for example:


Server version: Apache Tomcat/9.0.56
Server built:   Mar 10 2021 08:35:22 UTC
Server number:  9.0.56.0
OS Name:        Linux
OS Version:     5.4.0-74-generic
Architecture:   amd64
JVM Version:    11.0.11+9-Ubuntu-0ubuntu2.20.04
JVM Vendor:     Ubuntu

Identify the Version via the `MANIFEST.MF` File

Tomcat’s version information is recorded in the `MANIFEST.MF` file within the `catalina.jar` archive.

  • Locate the `catalina.jar` file within the `lib` directory of your Tomcat installation:
/path/to/tomcat/lib/catalina.jar
  • Use the `unzip` or `jar` command to extract and display the manifest file:
unzip -p /path/to/tomcat/lib/catalina.jar META-INF/MANIFEST.MF | grep "Implementation-Version"

Example output:

Implementation-Version: 9.0.56

Check the Version from the Web Interface

If Tomcat’s Manager web application is enabled, you can find the version through the web interface.

  • Access the Tomcat Manager by navigating to http://your-server-ip:8080/manager/html in a browser.
  • Log in with the manager credentials configured in the `tomcat-users.xml` file.
  • The Tomcat version is displayed in the top-right corner of the Manager page.

Note: This method requires that the Manager application is installed and accessible, and that you have valid credentials.

Using Package Manager Commands

If Tomcat was installed via a package manager such as `apt` or `yum`, the version can be queried directly.

Package Manager Command Example Output
APT (Debian, Ubuntu) apt-cache policy tomcat9
Installed: 9.0.31-1ubuntu0.20.04.4
Candidate: 9.0.31-1ubuntu0.20.04.4
Version table:
*** 9.0.31-1ubuntu0.20.04.4 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        
YUM (CentOS, RHEL) yum info tomcat
Name        : tomcat
Version     : 7.0.79
Release     : 10.el7_6
Architecture: noarch

This approach works only if Tomcat was installed using the system package manager rather than manually.

Expert Insights on Checking Tomcat Version in Linux

Dr. Anjali Mehta (Senior DevOps Engineer, CloudTech Solutions). When verifying the Tomcat version on a Linux system, the most straightforward approach is to navigate to the Tomcat installation directory and execute the command `./version.sh` located in the `bin` folder. This script provides detailed version information, including the server build and JVM details, which is essential for maintaining compatibility and security compliance.

Michael Chen (Linux Systems Administrator, Enterprise Web Services). From a system administration perspective, checking the Tomcat version can also be done by examining the `RELEASE-NOTES` or `RUNNING.txt` files found in the Tomcat root directory. Additionally, if Tomcat is running, querying the server via HTTP on the default port with a request to `/manager/status` or `/server-info` endpoints—assuming proper access—is a reliable method to retrieve version data without direct filesystem access.

Elena Rodriguez (Java Application Architect, NextGen Software). It is critical to ensure that the environment variables and paths are correctly set before attempting to check the Tomcat version on Linux. Using the command `catalina.sh version` from the Tomcat `bin` directory is a best practice, as it provides comprehensive version details. This method is particularly useful in automated scripts for deployment pipelines where precise version control is mandatory.

Frequently Asked Questions (FAQs)

How can I check the Tomcat version installed on my Linux system?
You can check the Tomcat version by navigating to the Tomcat installation directory and running the command `./bin/version.sh`. This script outputs the version details of the installed Tomcat server.

Is there a way to find the Tomcat version without starting the server?
Yes, executing the `version.sh` script inside the Tomcat `bin` directory does not require the server to be running and will display the version information.

Can I determine the Tomcat version by examining configuration or log files?
Sometimes, the Tomcat version is logged in the `catalina.out` log file during startup. Reviewing this file may reveal version details if the server has been started previously.

How do I check the Tomcat version if I installed it via a package manager on Linux?
If Tomcat was installed using a package manager like `apt` or `yum`, you can use commands such as `apt show tomcat` or `yum info tomcat` to display the installed version.

What command shows the Tomcat version when using systemd to manage the service?
Systemd does not provide the Tomcat version directly, but you can check the version by running the version script in the Tomcat directory or examining the service’s startup logs with `journalctl -u tomcat.service`.

Does the Tomcat Manager web application display the server version?
Yes, the Tomcat Manager web interface typically shows the server version on its main page once you log in, provided the Manager application is installed and accessible.
Determining the Tomcat version on a Linux system is a fundamental task for administrators and developers to ensure compatibility, security, and proper maintenance of web applications. Various methods can be employed to check the Tomcat version, including examining the version.sh script within the Tomcat installation directory, reviewing the RELEASE-NOTES or RUNNING.txt files, and querying the Tomcat Manager web application if it is enabled. Each approach offers a reliable way to identify the exact version running on the server without requiring complex commands or additional tools.

Understanding the Tomcat version is critical for applying appropriate patches, updates, and configurations. It also helps in troubleshooting issues and verifying that the deployment environment meets the necessary prerequisites for specific applications. By leveraging command-line utilities like `catalina.sh version` or inspecting version-related files, system administrators can quickly and accurately obtain version details, thereby streamlining maintenance workflows and enhancing operational efficiency.

In summary, regularly verifying the Tomcat version on Linux systems is a best practice that supports security compliance and system stability. Familiarity with multiple methods to retrieve this information empowers professionals to adapt to different server setups and access restrictions. Maintaining awareness of the Tomcat version ultimately contributes to better system management and optimized application performance.

Author Profile

Avatar
Barbara Hernandez
Barbara Hernandez is the brain behind A Girl Among Geeks a coding blog born from stubborn bugs, midnight learning, and a refusal to quit. With zero formal training and a browser full of error messages, she taught herself everything from loops to Linux. Her mission? Make tech less intimidating, one real answer at a time.

Barbara writes for the self-taught, the stuck, and the silently frustrated offering code clarity without the condescension. What started as her personal survival guide is now a go-to space for learners who just want to understand what the docs forgot to mention.