blog image what is apache tomcat
January 18, 2024

Java Basics: What Is Apache Tomcat?

Java Application Development
Open Source

Apache Tomcat is one of the top technologies in Java developers’ tech stacks—and for good reason. According to the 2024 Java Developer Productivity Report, 36% of Java developers use Apache Tomcat as their application server.  

But why is Apache Tomcat still popular in 2024, and how does the technology stack up against other application servers like Jetty, WebLogic, and Wildfly? In this blog, we give an overview of Apache Tomcat, including what it is, how it works, and why it continues to be a popular choice for Java users today. 

What Is Apache Tomcat?

Apache Tomcat is an open-source web server and Servlet container for Java code. It's a production-ready Java development tool used to implement many types of Jakarta EE (formerly known as Java EE) specifications. Apache Tomcat 10.1.18 is the current Tomcat release and is still undergoing active development. 

History of Apache Tomcat

As the reference implementation of Java Servlet and Java Server Pages (JSP), Tomcat was started at Sun Microsystems, which later donated the code base to the Apache Software Foundation in 1999.

Since then, multiple volunteers from Sun and other organizations have contributed to the product, which then led to a top-level Apache project designation. Nowadays, Apache Tomcat is widely used by many companies as it implements many of the Jakarta EE specifications, such as:

  • Java Servlet
  • JavaServer Pages
  • Java Expression Language
  • Java WebSockets 

Is Tomcat an Application Server or a Web Server?

Tomcat is considered a web server instead of an application server because it functions as a web server and Servlet container. It doesn’t provide the full feature set from Jakarta EE, but that isn't necessarily a disadvantage.  

Many applications require the same set of features that Tomcat provides, so it doesn't make sense to select heavier tools. In any case, Tomcat is a production-ready tool. 

Is Tomcat Still Popular in 2024?

According to our 2024 Java Developer Productivity Report, Apache Tomcat is used by 36% of Java teams. See the full data by downloading the report today. 

Application Server

Source: 2024 Java Developer Productivity Report

This high usage rate is due to the fact that Apache Tomcat is a very lightweight tool—but more importantly, it’s free. Apache Tomcat offers most of the basic functionality needed by many applications, has a fast startup time, and can be run in a number of different environments with minimal impact on resources.

Want to know what your peers are using in their Java tech stacks? Find the answers in the 2024 Java Developer Productivity Report. Download your free copy today. 

Get the report

If you ever run into an issue with Apache Tomcat, the extensive documentation produced by the Apache Software Foundation will likely help you find a solution. And if you can’t find it there, the Java community more than likely will be able to help figure out the solution because it is an open-source tool. It's also important to note that Tomcat isn't a one size fits all solution for Java applications. Picking the right application server always depends on the needs presented by the application. 

How Does Tomcat Work?

Tomcat is a platform-independent tool, and, as long there is Java installed, the installation is a straightforward process. You just need to download the desired version from the official website and then unpack it on your file system. You can verify that Tomcat is installed properly by running the server using a startup script in the $CATALINA_BASE/bin folder.

Once you start the server open your internet browser and navigate to URL http://localhost:8080 (if the default configuration is used). If you see a similar page as on the picture below, that means Tomcat was properly installed. 

image showing successful tomcat installation splash page

Deploying the application on to the server is easy. Tomcat supports deployment on the startup, which means you copy compressed (.WAR) or non-compressed (exploded web application) to the right directory, which is $CATALINA_BASE/webapps/.

If you prefer deploying the application on the fly, you can deploy the application to a running Tomcat server in the Tomcat Web Application Manager GUI. All the deployed applications can be managed via the Manager App in the Tomcat.

image showing tomcat web application manager menu

Deploying the application to the server is easy. Apache Tomcat supports deployment on the startup, which means you copy compressed (.WAR) or non-compressed (exploded web application) to the right directory, $CATALINA_BASE/webapps/.

If you prefer deploying the application on the fly, you can deploy the application to a running Tomcat server in the Tomcat Web Application Manager GUI. All the deployed applications can be managed via the Manager App in the Tomcat. 

📕 Related Resource: Need Tomcat Support? Talk to an Expert

Comparing Lightweight Servers: Tomcat vs. Jetty

When it comes to lightweight servers, Apache Tomcat is most often compared to Jetty. Jetty is an HTTP server and Servlet container that is often used as an embedded server. For a long time, Jetty was the only tool capable of running in embedded mode. As of now, Tomcat is already capable of running in the embedded mode as well.

Both Apache Tomcat and Jetty are open source: Tomcat was developed under the Apache 2.0 open source license and the Jetty license was managed by the Eclipse Foundation and available with Apache 2.0 and Eclipse Public License 1.0. 

Tomcat vs. Jetty

Tomcat Benefits

Jetty Benefits

Licensed with Apache 2.0

Prioritize needs of the user community

High market share

Small memory footprint

Focus on being up to date with the latest specification

Embeddable

Very well documented

 

Embeddable

 

While Apache Tomcat has a large market share and robust documentation, Jetty may be the better choice for applications with a low memory footprint. 

Comparing Lightweight Servers: Tomcat vs. WebLogic Server

The full implementation of Jakarta EE standards is available in Oracle WebLogic Server. WebLogic is a commercial project currently developed by Oracle Corporation and thus requires a license to be used for commercial purposes.

📚 Further reading: Learn more about WebLogic. 

WebLogic has several benefits over Tomcat, in that it supports distributed transactions using transaction managers, supports Enterprise Java Beans, and offers other functionalities that make it a good choice for commercial and enterprise applications. In addition, WebLogic comes with a great administration console that makes the management of the server a seamless process. 

Tomcat vs. Weblogic

Tomcat Benefits

WebLogic Benefits

Open source

Developed by Oracle Corporation

Quick start and redeploys

Supports Enterprise Java Beans (EJB)

Can be used freely for commercial projects<

Transactions management

If your application requires most or all the features of Jakarta EE and you need commercial support, WebLogic is the way to go despite the cost.  

Comparing Lightweight Servers: Tomcat vs. Wildfly

Another application server that implements full Jakarta EE specification is JBoss AS. Developed by Red Hat, Wildfly (formerly known as JBoss Application Server) is an open source platform that offers a rich feature set and is available for all the platforms where Java is available.  

Red Hat also introduced support for the community project for WildFly. If your main goal is to use Wildfly in the production environment, consider commercially supported enterprise options.  

Tomcat vs. Wildfly

Tomcat Benefits

WildFly Benefits

Open source

Full Java EE application server for free (WildFly)

Quick start and redeploys

Commercial support (JBoss EAP

 

Java EE 8 certified

Final Thoughts on Apache Tomcat

Choosing the right application server can be a tough decision for Java development teams. Consider the needs of the application—now and in the future—so you don’t select a tool that offers more than the application needs. This can add unwanted loads to memory, startup times, and configuration.

If you’re not sure which application server is sufficient for your Java development environment, you can start with Tomcat and see if it meets the needs of your application.  

While Apache Tomcat is not really a “pure” application server, comparing it with the other tools mentioned above should give you insight into how each tool should be applied. Looking for further efficiency in your Java development practice? Try JRebel. By eliminating redeploys, your team could save a month of Java development time annually.  

See how much time your team could save during your 14-day free trial.  

Try free 

Editor's Note: This blog was originally published in March 2022 and has been updated for clarity and relevance.