Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » How to install Apache Tomcat on Ubuntu
  • maxresdefault
    Error 0x8007232B: Can’t activate Windows on this device as we can’t connect to your organization’s activation server Windows
  • HyperV copy
    How to convert a VHDX file to a VHD Virtualization
  • Installing Jenkins
    How to Install and Configure Jenkins on Windows 11 Configuration Management Tool
  • image 24
    How to Resolve Microsoft RDP Connection Black Screen Windows
  • asdfgh
    Install RSAT on Windows via Windows features Windows
  • Prevent OS Reinstallation When Switching from Legacy BIOS to UEFI
    Prevent OS Reinstallation: Change from legacy BIOS to UEFI Windows
  • Auto Update Upgrade issues
    Fix Microsoft Office Showing “Upgrade Required” in AutoUpdate JIRA|Confluence|Apps
  • Step to migrate from microsft SQl to PostgreSQL
    Migrate Veeam Configuration Database to PostgreSQL Server Backup

How to install Apache Tomcat on Ubuntu

Posted on 28/12/202125/03/2024 Raphael Gab-Momoh By Raphael Gab-Momoh No Comments on How to install Apache Tomcat on Ubuntu
final-tomcat-feature

Tomcat, also known as Apache Tomcat, is a Java-based web application server that is free, open-source, and lightweight. Programmers use it to implement the Java Servlet and Java Server Pages technologies (including Java Expression Language and Java WebSocket). Tomcat allows developers to create a variety of enterprise Java applications. That’s why this guide is created to help you install Apache Tomcat on Ubuntu. Please see How to upgrade Apache Tomcat from One Version to another,how to Install Apache HTTP Server on Ubuntu 20.04 LTS, and How to rebind Tomcat Keystore with a new Certificate.

In addition to running Java code, Tomcat also runs an HTTP web server environment.  The most recent stable version of Tomcat is series 9.0.56, which is the first Apache Tomcat release to implement Servlet 4.0 requirements at the time of writing this guide. Tomcat is maintained by a large group of developers. 

The Coyote engine, which is included with Tomcat, is a web server that allows developers to connect a variety of Java enterprise applications and capabilities. Version 9.0.56 has the following properties:

  • Provide protection against a known OS bug that causes the acceptor to report an incoming connection more than once.
  • Implement a workaround for a JVM bug that can trigger a file descriptor leak when using multi-part upload and the application does not explicitly close an input stream for an uploaded file that was cached on disk.
  • Fix exceptions when the security manager is enabled, and the first request received after starting is an HTTP request to a TLS-enabled NIO2 connector.

Tomcat converts JSP files (server-generated webpages comparable to PHP and ASP files) to Java code, which the server then compiles into. Class files and runs on the Java virtual machine. As of now, Tomcat is unquestionably one of the most useful servlet containers on the market.

See more here: tomcat. Read on to learn more about the server and how to install Apache Tomcat on Ubuntu. Please see How to install Java Runtime Environment on Mac OS.

Uses of Apache Tomcat

Apache Tomcat is one of the most extensively used Java servers, it has a wide range of applications. For example, KonaKart, a Java-based shopping cart application, runs on Tomcat and makes use of it as a Java API and SOAP Web Service interface.

Tomcat has been altered and moulded by several developers because of its open-source nature; distributors include Spring source’s Enterprise Ready Server (ERS)

Tomcat is also utilized in cloud environments, such as Axon datacenters, where Tomcat is deployed in part. The Apache Tomcat project is meant to be a collaboration of the best-of-breed developers from around the world, according to the Apache Tomcat team.

Across a wide range of sectors and organizations, Apache Tomcat software drives countless large-scale, mission-critical online applications.

Benefit of using Apache Tomcat

1: In Ubuntu, Tomcat provides a simple and speedy way to run your applications. It allows for faster loading and makes a server work more efficiently.

2: Tomcat comes with a number of built-in customization options that allow users to operate in a variety of ways.

3: Tomcat is an open-source application that is free to use. It allows for extensive customization thanks to code access.

4: Tomcat provides an extra layer of protection to its consumers. Because of its stability, even if Tomcat has problems, the rest of the server continues to function.

With this step-by-step guide, I will teach you how to install Tomcat on any version of Ubuntu, because the code works on about any. The steps were evaluated on all versions of Ubuntu, but the screenshot demo was on version 18.04. However, for other versions the steps are the same.

Other guide can be gotten from here: How to install MariaDB on Ubuntu/ and How to Install LAMP Stack on Ubuntu 18.04/ also How to Configure Advanced PAM in Linux/ and How to locate directory file context and restore it with SELinux

Installing Apache Tomcat on Ubuntu

Step 1: Apt update

To run the Java web application code, we need to install Java before we can install Tomcat on Ubuntu. In Ubuntu, we need a java runtime environment to proceed with this. Java is easy to set up and use. Simply follow the instructions below:

sudo apt update

Install the Java platform

sudo apt install default-jre

To verify that the operation succeeded, let’s run the command

java -version
how to install Apache tomcat on Ubuntu-java-version
java version

Step 2: Check for Tomcat in Repository

 The repository will show you all the latest packages available for download.

sudo apt-cache search tomcat
how to install apache tomcat on Ubuntu-cache-search
apt-cache-tomcat

Step 3: Download Apache Tomcat

Download the tomcat9 package and the tomcat9 admin package and its dependencies with the following terminal command.

sudo apt install tomcat9 tomcat9-admin
how to install apache tomcat on ubuntu-tomcat
installed! tomcat

Step 4: Install Apache Tomcat Server on Ubuntu

 ss -ltn
how to install apache tomcat on ubuntu-listen
reserving port

8080 open port number, the default open port reserved for Apache Tomcat Server.

Step 5: Enable or Disable tomcat

 sudo systemctl enable tomcat9
how to install apache tomcat on Ubuntu-enable
enabling tomcat

or

sudo systemctl disable tomcat9

Step 6: Allow Traffic to Port 8080

To allow traffic from any source to port 8080 of the Tomcat Server, type in the following command.

 sudo ufw allow from any to any port 8080 proto tcp
fwall
ufw

Step 7: Test Installed Apache Tomcat Server

You can connect to the Tomcat server using the system’s dynamic ip address by entering the port and the address in the URL search box as follows:

first do ip addr show to get your ip address

ip-add
ip-address
http://192.168.125.132:8080
tomcatpage
it works!

Step 8: Create User

To use the Apache Tomcat Web Application Manager, you’ll need to create a new user account.

Open the tomcat-users.xml file in the Tomcat directory with your favorite text editor.

 sudo nano /etc/tomcat9/tomcat-users.xml

Add these three tagged lines to the file above the “<>” tag when it is opened. Here, a new user with the name “techdirectarchive” and the password “raphael” has been made. Substitute your own values for the username and password. We just added the line below to the file without making any modification to what was existing

<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="techdirectarchive" password="raphael"roles="admin-gui,manager-gui"/>
users-tomcat
user -file

Step 10: Restart Apache Tomcat on Ubuntu

systemcl restart tomcat-9
passwordusername
password & username

Summary

The Apache Tomcat Server is a fantastic piece of software for setting up a Java HTTP server. It’s quite simple to set up Apache Tomcat Server on Ubuntu, and it doesn’t require any complicated procedures. Just follow the steps above and you will be able to install Apache Tomcat on any version of ubuntu.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Linux

Post navigation

Previous Post: Install Let’s Encrypt Wildcard SSL Certificate in cPanel using Certify The Web
Next Post: How to Install Terraform on Linux

Related Posts

  • runlevels
    How to check your current Runlevel in Linux Linux
  • Gfeature
    How to install Googler on a Linux System Linux
  • linux tux minimalism 4k 42 2560x1700 1 1
    Warning useradd: the home directory already exists. Not copying any file from skel director into it Linux
  • Groovy
    How to install Groovy on Linux and Windows Configuration Management Tool
  • Locate Find and Grep Required 1
    Locate, Find and Grep: Search for files and patterns in Linux or Unix-like OS Linux
  • physical
    Linux Machine: Is it Virtual or a Physical server Linux

More Related Articles

runlevels How to check your current Runlevel in Linux Linux
Gfeature How to install Googler on a Linux System Linux
linux tux minimalism 4k 42 2560x1700 1 1 Warning useradd: the home directory already exists. Not copying any file from skel director into it Linux
Groovy How to install Groovy on Linux and Windows Configuration Management Tool
Locate Find and Grep Required 1 Locate, Find and Grep: Search for files and patterns in Linux or Unix-like OS Linux
physical Linux Machine: Is it Virtual or a Physical server Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • maxresdefault
    Error 0x8007232B: Can’t activate Windows on this device as we can’t connect to your organization’s activation server Windows
  • HyperV copy
    How to convert a VHDX file to a VHD Virtualization
  • Installing Jenkins
    How to Install and Configure Jenkins on Windows 11 Configuration Management Tool
  • image 24
    How to Resolve Microsoft RDP Connection Black Screen Windows
  • asdfgh
    Install RSAT on Windows via Windows features Windows
  • Prevent OS Reinstallation When Switching from Legacy BIOS to UEFI
    Prevent OS Reinstallation: Change from legacy BIOS to UEFI Windows
  • Auto Update Upgrade issues
    Fix Microsoft Office Showing “Upgrade Required” in AutoUpdate JIRA|Confluence|Apps
  • Step to migrate from microsft SQl to PostgreSQL
    Migrate Veeam Configuration Database to PostgreSQL Server Backup

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,825 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.