This guide walks you through downloading Apache Tomcat, configuring the required environment variables, starting the server, and deploying a simple WAR file. By the end you will have a running Tomcat instance accessible atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apache/tomcat/llms.txt
Use this file to discover all available pages before exploring further.
http://localhost:8080 and a working web application deployed from the webapps/ directory.
Apache Tomcat requires a Java Standard Edition Runtime Environment (JRE) version 11 or later. Download the latest JDK from adoptium.net or oracle.com/java. The full JDK is recommended over a bare JRE because it provides additional startup options. Verify your installation with
java -version before proceeding.Download and Extract Tomcat
Download the latest Tomcat binary distribution from tomcat.apache.org. Choose the The extracted directory (e.g.,
.tar.gz archive on Linux/macOS or the .zip archive on Windows./opt/apache-tomcat-11.0.x) is your CATALINA_HOME — the root of the Tomcat binary distribution. It contains all startup scripts, shared libraries, and default configuration files.Your directory structure should look like this:Set Environment Variables
Tomcat’s startup scripts rely on two environment variables.
JAVA_HOME points to your JDK installation and CATALINA_HOME points to the extracted Tomcat directory.If both
JRE_HOME and JAVA_HOME are set, Tomcat’s startup scripts prefer JRE_HOME. Use JAVA_HOME for full JDK features. You can also place these exports in $CATALINA_HOME/bin/setenv.sh (Linux/macOS) or %CATALINA_HOME%\bin\setenv.bat (Windows) to keep them scoped to Tomcat.Start the Server
Use the startup script provided in To stop Tomcat, use the matching shutdown script:Watch the log output to confirm a successful start:A successful startup ends with a line similar to:
$CATALINA_HOME/bin/. The script starts Tomcat as a background process and writes output to logs/catalina.out.Verify the Installation
With Tomcat running, confirm that the default web application responds on port 8080:Open
http://localhost:8080 in a browser. You should see the Tomcat welcome page with links to documentation, examples, and the Manager application.If port 8080 is already in use, edit
$CATALINA_HOME/conf/server.xml and change the port attribute on the <Connector> element to any unused port above 1024. Restart Tomcat and use the new port in your browser URL.Deploy a Web Application
The simplest deployment method is the drop-in WAR approach. Tomcat’s default For a minimal servlet application, your project must contain a The corresponding servlet source:Package the application into a WAR file and drop it into
<Host> configuration sets autoDeploy="true", which means Tomcat watches the webapps/ directory and automatically deploys any .war file placed there — no restart required.WEB-INF/web.xml deployment descriptor. Here is the minimum structure and a sample web.xml:webapps/:Installation Guide
Detailed installation instructions including running as a system service, multiple instances, and Windows service setup.
Configuration Reference
Complete reference for
conf/server.xml — Connectors, Engines, Hosts, Contexts, Realms, and Valves.