Changing data path in Tomcat 7


I'm running the WAR distribution of TeamCity on a Linux system with Tomcat 7. I seem to be unable to change the data path used by TeamCity.

So far I've tried:

  • Globally setting the TEAMCITY_DATA_PATH environment variable for my server (the docs are talking about a Linux environment variable, not some other kind of Tomcat environment variable, are they?). I even rebooted my server to ensure the environment variable was set for the shell Tomcat runs in.
  • Adding the following to my conf/web.xml:


Both times, TeamCity complained about not being able to create its database in /dev/null/.BuildServer.

I'm not that familiar with Tomcat and its inner workings, but I think that assigning a home directory for my Tomcat user or editing Tomcat's init script would not be the cleanest of options.


I also attempted to add the <env-entry /> to my WEB-INF/web.xml without success.

Then I tried putting it in my /etc/conf.d/tomcat-7 (no idea what the equivalent on other distros than Gentoo is):

# Where your web applications are located

# TeamCity home directory

Again, no success.

Running a 'grep -r "TEAMCITY_DATA_PATH" *' on the extracted contents of the WAR archive yields nothing, as does a 'grep -r "" *'. I am beginning to believe that the documentation is simply wrong.


Hello Markus,

What version of TeamCity do you use?

Thanks in advance,


Same problem. I want to have 6.0 and 6.5 teamcitys, running simultaniously on my tomcat 6. But unfortunally, i can specify data path only in global JAVA_OPTS ('/lfoo/bar/').
Is there any solution to define data path for tomcat application, not to whole JVM, if I have 2 separate databases and 2 .BuildServer folders&


I'm running TeamCity 6.0.2.

Thanks @Stas, I didn't try setting JAVA_OPTS globally for my TomCat yet.

I did in the meantime install Jenkins, another CI server, on my system and it took me less than 5 minutes to figure out: after installing the package, one can simply define the home directory in the instance's web.xml (on my system found in /var/lib/tomcat-7/webapps/jenkins/WEB-INF/ where 'jenkins' is the name of the instance):

<!-- if specified, this value is used as the Hudson home directory -->

Wish it was that easy with TeamCity :)


Hi Markus

Thanks for feedback. We created a request TW-15868, please comment/vote for it.



Hi Stas

Could you share a use case with us - what's a goal to have two TeamCity instances deployed in parallel?



It's cool to have ability to deploy new version of TC on same server as current working TC, to check if it works with my projects on definite server.


Please sign in to leave a comment.