What is the Tomcat installation directory?

There are three important directories for Tomcat:

  • /etc/tomcat{X} for configuration

  • /usr/share/tomcat{X} for runtime, called CATALINA_HOME

  • /usr/share/tomcat{X}-root for webapps

The alternative path to Tomcat, called CATALINA_BASE, is /var/lib/tomcat{X}

The temp folder for Tomcat is /tmp/tomcat{X}-tomcat{X}-tmp

All the above paths work for Tomcat 6, 7, and 8. Replace {X} with the appropriate Tomcat major version number, e.g. /etc/tomcat8.


After installing Tomcat with apt-get on Ubuntu 12.04, Tomcat creates and uses these directories:

/etc/tomcat6/

/etc/tomcat6/
├── Catalina
│   └── localhost
│       ├── ROOT.xml
│       └── solr.xml -> ../../../solr/solr-tomcat.xml
├── catalina.properties
├── context.xml
├── logging.properties
├── policy.d
│   ├── 01system.policy
│   ├── 02debian.policy
│   ├── 03catalina.policy
│   ├── 04webapps.policy
│   ├── 05solr.policy -> /etc/solr/tomcat.policy
│   └── 50local.policy
├── server.xml
├── tomcat-users.xml
└── web.xml

/usr/share/tomcat6

/usr/share/tomcat6
├── bin
│   ├── bootstrap.jar
│   ├── catalina.sh
│   ├── catalina-tasks.xml
│   ├── digest.sh
│   ├── setclasspath.sh
│   ├── shutdown.sh
│   ├── startup.sh
│   ├── tomcat-juli.jar -> ../../java/tomcat-juli.jar
│   ├── tool-wrapper.sh
│   └── version.sh
├── defaults.md5sum
├── defaults.template
└── lib
    ├── annotations-api.jar -> ../../java/annotations-api-6.0.35.jar
    ├── catalina-ant.jar -> ../../java/catalina-ant-6.0.35.jar
    ├── catalina-ha.jar -> ../../java/catalina-ha-6.0.35.jar
    ├── catalina.jar -> ../../java/catalina-6.0.35.jar
    ├── catalina-tribes.jar -> ../../java/catalina-tribes-6.0.35.jar
    ├── commons-dbcp.jar -> ../../java/commons-dbcp.jar
    ├── commons-pool.jar -> ../../java/commons-pool.jar
    ├── el-api.jar -> ../../java/el-api-2.1.jar
    ├── jasper-el.jar -> ../../java/jasper-el-6.0.35.jar
    ├── jasper.jar -> ../../java/jasper-6.0.35.jar
    ├── jasper-jdt.jar -> ../../java/ecj.jar
    ├── jsp-api.jar -> ../../java/jsp-api-2.1.jar
    ├── servlet-api.jar -> ../../java/servlet-api-2.5.jar
    ├── tomcat-coyote.jar -> ../../java/tomcat-coyote-6.0.35.jar
    ├── tomcat-i18n-es.jar -> ../../java/tomcat-i18n-es-6.0.35.jar
    ├── tomcat-i18n-fr.jar -> ../../java/tomcat-i18n-fr-6.0.35.jar
    └── tomcat-i18n-ja.jar -> ../../java/tomcat-i18n-ja-6.0.35.jar

/usr/share/tomcat6-root/

/usr/share/tomcat6-root/
└── default_root
    ├── index.html
    └── META-INF
        └── context.xml

/usr/share/doc/tomcat6

/usr/share/doc/tomcat6
├── changelog.Debian.gz -> ../libtomcat6-java/changelog.Debian.gz
├── copyright
└── README.Debian.gz -> ../tomcat6-common/README.Debian.gz

/var/cache/tomcat6

/var/cache/tomcat6
├── Catalina
│   └── localhost
│       ├── _
│       └── solr
│           └── org
│               └── apache
│                   └── jsp
│                       ├── admin
│                       │   ├── form_jsp.class
│                       │   ├── form_jsp.java
│                       │   ├── get_002dproperties_jsp.class
│                       │   ├── get_002dproperties_jsp.java
│                       │   ├── index_jsp.class
│                       │   ├── index_jsp.java
│                       │   ├── schema_jsp.class
│                       │   ├── schema_jsp.java
│                       │   ├── stats_jsp.class
│                       │   ├── stats_jsp.java
│                       │   ├── threaddump_jsp.class
│                       │   └── threaddump_jsp.java
│                       ├── index_jsp.class
│                       └── index_jsp.java
└── catalina.policy

/var/lib/tomcat6

/var/lib/tomcat6
├── common
│   └── classes
├── conf -> /etc/tomcat6
├── logs -> ../../log/tomcat6
├── server
│   └── classes
├── shared
│   └── classes
├── webapps
│   └── ROOT
│       ├── index.html
│       └── META-INF
│           └── context.xml
└── work -> ../../cache/tomcat6

/var/log/tomcat6

/var/log/tomcat6
├── catalina.2013-06-28.log
├── catalina.2013-06-30.log
├── catalina.out
├── catalina.out.1.gz
└── localhost.2013-06-28.log

/etc/default

/etc/default
├── tomcat7

If you install Tomcat 7 using apt:

sudo apt-get install tomcat7

Then the webapps are located in /var/lib/tomcat7

$ tree  /var/lib/tomcat7 -L 2
/var/lib/tomcat7
├── common
│   └── classes
├── conf -> /etc/tomcat7
├── logs -> ../../log/tomcat7
├── server
│   └── classes
├── shared
│   └── classes
├── webapps
│   └── ROOT
└── work -> ../../cache/tomcat7