Multiple Tomcat instances on Windows with CATALINA_BASE
Share one Tomcat install, create isolated CATALINA_BASE directories, change ports, and register each instance as its own service.
- Build
- 26100.33650
- Edition
- Standard / Datacenter
- Architecture
- x64
- Support
- Documentation (E1)
- Evidence
- E1Official documentation
- Verified
- 2026-10-29
- Page type
- Task
The short answer
Section titled “The short answer”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_HOMEC:\tomcat\instances\a CATALINA_BASEC:\tomcat\instances\b CATALINA_BASEEach base has its own conf/server.xml with different ports.
Create an instance
Section titled “Create an instance”$home = 'C:\tomcat'$base = 'C:\tomcat\instances\a'New-Item -ItemType Directory -Force $base\conf,$base\logs,$base\temp,$base\webapps,$base\work | Out-NullCopy-Item "$home\conf\*" "$base\conf" -Recurse -ForceDo 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.
Start an instance
Section titled “Start an instance”set "CATALINA_HOME=C:\tomcat"set "CATALINA_BASE=C:\tomcat\instances\a"C:\tomcat\bin\catalina.bat runFor 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:
Get-CimInstance Win32_Process -Filter "Name='java.exe'" | Select-Object ProcessId, CommandLineInvoke-WebRequest http://localhost:8080/ -UseBasicParsing | Select-Object StatusCodeInvoke-WebRequest http://localhost:8081/ -UseBasicParsing | Select-Object StatusCode-Dcatalina.base=... in the command line proves which base each JVM uses.
Deploy and isolate
Section titled “Deploy and isolate”- Put each app in its own
webappsor deploy a context XML pointing at an external path. - Keep
logs,temp,workper base. - Do not share a JDK unless intended; pin
JAVA_HOMEper instance (see Java multi-version). - One instance crashing should not take the other’s ports or logs.
Lab boundary
Section titled “Lab boundary”E1. The lab did not install Tomcat; the layout and commands are the multi-instance procedure to verify on Server 2025.