Start two or more Tomcat instances on localhost machine

Octocat Save up to a workweek a year by efficiently managing your coding bookmarks, aka #codingmarks, on Share your favorites with the community and they will be published weekly on Github. 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?

How I save a workweek a year by efficiently managing my codingmarks

Finding a desired link, you already visited, can be a tedious job and sometimes even frustrating. It normally takes 30 seconds or more to look for a link the traditional way, and I do that at least 20 times a day. With it takes about 10 seconds, so I get a time saving of around 20 * 20 / 60 = 6.66 minutes a day. Over a year's time this translates to around 40+ hours of saved time. Continue reading

New codingmarks published in week 52 of 2018

Published on January 01, 2019