Start two or more Tomcat instances on localhost machine

Octocat **Promotion** - Efficiently manage your coding bookmarks, aka #codingmarks, on and share your hidden gems with the world. They are published weekly on Github. You can help us build THE programming-resources location - Star

There are to main applications, that power, one that is actually the web application and another one where I do administrative stuff and podcast updates. Experience has shown that if I want to run the podcasts updates in the background and do some testing/debugging/redployment on the front-end application it’s better to have them running on different Tomcat instances on the development machine.

How do I do that? It’s very easy. First make a copy of one instance and name it as you please:

Clone Tomcat directory

Clone Tomcat directory

After that go to the conf/server.xml file and modify the ports from the Connector entries:


<Connector port="8080" protocol="HTTP/1.1"
		   redirectPort="8443" />
<!-- Define an AJP 1.3 Connector on port 8010 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


<Connector port="8081" protocol="HTTP/1.1"
		   redirectPort="8444" />
<!-- Define an AJP 1.3 Connector on port 8010 -->
<Connector port="8010" protocol="AJP/1.3" redirectPort="8444" />

And then start your two instances. Because I still get an Address already in use: JVM_Bind error:

27.11.2013 06:56:47 org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]: Address already in use: JVM_Bind
	at Method)
	at org.apache.catalina.core.StandardServer.await(
	at org.apache.catalina.startup.Catalina.await(
	at org.apache.catalina.startup.Catalina.start(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.apache.catalina.startup.Bootstrap.start(
	at org.apache.catalina.startup.Bootstrap.main(

it means I have forgot to change the port number from the Server entry:


<Server port="8005" shutdown="SHUTDOWN">


<Server port="8006" shutdown="SHUTDOWN">

That’s it. You should now be able to run the two instances of Tomcat 7 with no trouble. If you want to start a third one and so one, follow the same procedure and use different port numbers.

Don’t forget to check out – you might find it really interesting. We are grateful for your support.

Podcastpedia image

Adrian Matei

Creator of and, computer science engineer, husband, father, curious and passionate about science, computers, software, education, economics, social equity, philosophy - but these are just outside labels and not that important, deep inside we are all just consciousness, right?

New codingmarks published in week 48 of 2018

New codingmarks published in week 48 of 2018. Keywords: android, angular, api, documentation, feign, graphql, http, http-client, http2, https, java, kotlin, mapper, mapping, odata, rest, rest-client, spring, spring-boot and swagger Continue reading

New codingmarks published in week 46 of 2018

Published on November 20, 2018

New codingmarks published in week 45of 2018

Published on November 13, 2018