Skip to content

Multiple Tomcat instances on Windows with CATALINA_BASE

Verified 1 min read

Share one Tomcat install, create isolated CATALINA_BASE directories, change ports, and register each instance as its own service.

Tested onStandard / Datacenter · Build 26100.33650 · x64
E1
Build
26100.33650
Edition
Standard / Datacenter
Architecture
x64
Support
Documentation (E1)
Evidence
E1Official documentation
Verified
2026-10-29
Page type
Task

CATALINA_HOME is the Tomcat binaries. CATALINA_BASE is one instance’s config, logs, webapps and work.

Run two instances from one install:

C:\tomcat\ CATALINA_HOME
C:\tomcat\instances\a CATALINA_BASE
C:\tomcat\instances\b CATALINA_BASE

Each base has its own conf/server.xml with different ports.

Terminal window
$home = 'C:\tomcat'
$base = 'C:\tomcat\instances\a'
New-Item -ItemType Directory -Force $base\conf,$base\logs,$base\temp,$base\webapps,$base\work | Out-Null
Copy-Item "$home\conf\*" "$base\conf" -Recurse -Force

Do not copy logs/work content; create empty directories. Copy conf as the starting point, then edit.

In C:\tomcat\instances\a\conf\server.xml:

<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" />
<Connector port="8009" protocol="AJP/1.3" secretRequired="true" />
</Server>

For instance B use 8006, 8081, 8010 (or disable AJP if unused). Every port must be unique across instances: shutdown, HTTP, AJP, redirect.

Terminal window
set "CATALINA_HOME=C:\tomcat"
set "CATALINA_BASE=C:\tomcat\instances\a"
C:\tomcat\bin\catalina.bat run

For services, register each base separately. With the Tomcat service manager, use a distinct service name and point it at the base; do not register the same service twice. Verify:

Terminal window
Get-CimInstance Win32_Process -Filter "Name='java.exe'" |
Select-Object ProcessId, CommandLine
Invoke-WebRequest http://localhost:8080/ -UseBasicParsing | Select-Object StatusCode
Invoke-WebRequest http://localhost:8081/ -UseBasicParsing | Select-Object StatusCode

-Dcatalina.base=... in the command line proves which base each JVM uses.

  • Put each app in its own webapps or deploy a context XML pointing at an external path.
  • Keep logs, temp, work per base.
  • Do not share a JDK unless intended; pin JAVA_HOME per instance (see Java multi-version).
  • One instance crashing should not take the other’s ports or logs.

E1. The lab did not install Tomcat; the layout and commands are the multi-instance procedure to verify on Server 2025.

Sources