This page covers a complete, production-ready Apache Tomcat installation across Linux, macOS, and Windows. Beyond the basics of downloading and starting Tomcat, you will learn how to run Tomcat as a system service (systemd on Linux, Windows Service on Windows), validate your configuration with the built-inDocumentation 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.
configtest command, and use the CATALINA_BASE pattern to run multiple independent Tomcat instances from a single shared binary installation.
System Requirements
Apache Tomcat is a Java application and requires a compatible Java runtime. The minimum Java version and specification targets vary by Tomcat major release:| Tomcat Version | Jakarta Servlet | Jakarta Pages | Minimum Java Version |
|---|---|---|---|
| 11.0.x | 6.0 | 4.0 | 17 |
| 10.1.x | 6.0 | 3.1 | 11 |
| 9.0.x | 4.0 | 2.3 | 8 |
Tomcat 10.x and 11.x use the
jakarta.* package namespace (Jakarta EE 9+). Applications written against the javax.* namespace (Java EE 8 and earlier) must target Tomcat 9.x or be migrated using the Tomcat Migration Tool for Jakarta EE. The JRE_HOME variable may be used instead of JAVA_HOME, but JAVA_HOME is recommended as it unlocks additional startup options.Directory Layout
When you extract a Tomcat binary distribution,CATALINA_HOME is the root of that directory. The standard layout is:
| Directory | Purpose |
|---|---|
bin/ | Startup and shutdown scripts (startup.sh, shutdown.sh, catalina.sh on Unix; .bat equivalents on Windows). Also contains bootstrap.jar and tomcat-juli.jar. |
conf/ | Server configuration files. The primary file is server.xml. Also contains web.xml (global servlet defaults), context.xml (global context defaults), tomcat-users.xml, and logging.properties. |
lib/ | JAR libraries shared across all web applications — catalina.jar, servlet-api.jar, jsp-api.jar, and others. |
logs/ | Runtime log files. catalina.out captures stdout/stderr from the JVM. Access logs (e.g., localhost_access_log.YYYY-MM-DD.txt) are written here by the AccessLogValve. |
webapps/ | The default application base directory. Any WAR file or expanded directory placed here is automatically deployed when autoDeploy="true" on the <Host>. Ships with ROOT, docs, examples, host-manager, and manager. |
work/ | Jasper’s working directory for compiled JSP classes. Each context gets its own subdirectory under work/Catalina/<hostname>/<context-path>/. |
temp/ | Directory passed to the JVM as java.io.tmpdir. Used for temporary files by Tomcat and running web applications. |
CATALINA_HOME vs CATALINA_BASE
Tomcat distinguishes between two root directories to support running multiple server instances from a single binary installation:CATALINA_HOME is the location of the Tomcat binary distribution — startup scripts, shared libraries, and the base set of files that never change between instances. You download and extract this once.
CATALINA_BASE is the location of the active configuration and runtime state for a specific Tomcat instance — conf/, logs/, webapps/, work/, and temp/. It defaults to the same value as CATALINA_HOME when running a single instance.
When CATALINA_BASE and CATALINA_HOME are set to different directories, the split is as follows:
Directories read from CATALINA_BASE:
| Path | Content |
|---|---|
bin/setenv.sh (or .bat) | Instance-specific environment variable overrides |
bin/tomcat-juli.jar | Instance-specific logging implementation (optional override) |
conf/ | All server configuration files, including server.xml |
lib/ | Instance-specific JAR libraries (e.g., JDBC drivers) |
logs/ | Log and output files for this instance |
webapps/ | Deployed web applications for this instance |
work/ | JSP compilation working directories |
temp/ | JVM temporary files for this instance |
CATALINA_HOME:
| Path | Content |
|---|---|
bin/ | All startup/shutdown scripts (unless overridden in CATALINA_BASE/bin/) |
lib/ | Shared Tomcat libraries (merged with CATALINA_BASE/lib/ at startup; CATALINA_BASE entries take precedence) |
CATALINA_HOME and CATALINA_BASE are available as ${catalina.home} and ${catalina.base} within XML configuration files, making it straightforward to reference shared resources.
Linux / macOS Installation
Download and Extract
Download the latest
.tar.gz binary distribution from tomcat.apache.org and extract it to a permanent location:Set JAVA_HOME and CATALINA_HOME
Add the environment variables to your shell profile. For system-wide availability, add them to You can also create a
/etc/environment or /etc/profile.d/tomcat.sh. For a single user, use ~/.bash_profile or ~/.zshrc:setenv.sh file inside $CATALINA_HOME/bin/ to configure Tomcat-specific options without polluting your global shell environment:Use
CATALINA_OPTS for JVM flags that affect only the Tomcat server process (e.g., heap settings). Use JAVA_OPTS only for options that must apply to both the start and stop commands. Never set memory limits in JAVA_OPTS.Make Scripts Executable
Binary distributions downloaded on Linux or macOS may not have the execute bit set on the shell scripts:
Windows Installation
Download
From tomcat.apache.org, choose either:
- 32-bit/64-bit Windows zip — a portable, no-installer distribution equivalent to the
.tar.gzon Unix. - 32-bit/64-bit Windows Service Installer (
.exe) — installs Tomcat as a Windows Service automatically using Apache Commons Procrun (tomcat11.exe/tomcat11w.exe).
C:\apache-tomcat-11.0.x.Set Environment Variables
Open System Properties → Advanced → Environment Variables and add:Or set them persistently from an elevated Command Prompt:Optionally create
%CATALINA_HOME%\bin\setenv.bat for Tomcat-specific options:Start Tomcat
Open a Command Prompt and run:A new console window opens showing Tomcat’s log output. To stop the server:
Optional: Install as a Windows Service
The Windows ZIP distribution ships with After installation, the service appears in Services (
service.bat, which wraps Tomcat using Apache Commons Daemon Procrun. From an elevated (Administrator) Command Prompt:services.msc) and can be configured to start automatically. The graphical monitor application (tomcat11w.exe) lets you adjust JVM options, logging, and startup mode through a GUI.Running Multiple Instances
TheCATALINA_BASE pattern lets you run several isolated Tomcat instances — each with its own configuration, web applications, and log files — from a single shared binary installation. This is ideal for hosting multiple environments (dev/staging/prod) or multiple tenants on the same host.
Create a separate CATALINA_BASE directory for each instance with only the directories that vary per instance:
$INSTANCE/conf/server.xml to use a unique port set (the default 8005, 8080, and 8443 must not conflict between instances):
CATALINA_BASE before calling the shared startup script:
setenv.sh to make this self-contained:
Validating Configuration
Quickstart
A concise five-step guide to download, configure, start Tomcat, and deploy your first web application.
Configuration Reference
Full reference documentation for every element in
conf/server.xml, including Connectors, Valves, Realms, and Executors.