How To

Install Tomcat 10 on Ubuntu 22.04 Easily

Apache Tomcat remains one of the most trusted platforms for running Java-based web applications. If you want to deploy enterprise apps, APIs, or servlet-based projects, learning how to Install Tomcat 10 on Ubuntu 22.04 is an essential skill. Fortunately, the setup process is straightforward and works well for both testing and production environments.

Tomcat 10 delivers improved Jakarta EE support, better performance, and enhanced stability. In this guide, you will learn how to install Java, configure Tomcat as a service, enable firewall access, and secure the management dashboard.

Why Install Tomcat 10 on Ubuntu

Many developers prefer Tomcat because it is lightweight, reliable, and easy to maintain. In addition, Ubuntu 22.04 provides long-term support, making it a solid platform for Java applications.

Tomcat works perfectly for:

  • Java servlet applications
  • Enterprise web platforms
  • REST APIs
  • Development and testing servers
  • Spring-based applications

Before you begin, ensure your Ubuntu server has sudo privileges.

Install Tomcat 10 Dependencies

Tomcat requires Java 11 or later. First, update the package repository and install OpenJDK:

sudo apt update
sudo apt install openjdk-11-jdk

Next, verify the Java installation:

java -version

After that, create a dedicated Tomcat user for improved security:

sudo useradd -m -U -d /opt/tomcat -s /bin/false tomcat

Using a separate service account helps reduce security risks and keeps permissions organized.

Download and Install Tomcat 10

To Install Tomcat 10, download the latest Tomcat archive from the official Apache mirrors:

VERSION=10.1.4
wget https://downloads.apache.org/tomcat/tomcat-10/v${VERSION}/bin/apache-tomcat-${VERSION}.tar.gz -P /tmp

Now extract the package:

sudo tar -xf /tmp/apache-tomcat-${VERSION}.tar.gz -C /opt/tomcat/

Create a symbolic link for easier upgrades later:

sudo ln -s /opt/tomcat/apache-tomcat-${VERSION} /opt/tomcat/latest

Then assign the correct ownership:

sudo chown -R tomcat: /opt/tomcat
sudo chmod +x /opt/tomcat/latest/bin/*.sh

At this stage, Tomcat files are ready for configuration.

Configure Tomcat 10 Service

Instead of launching Tomcat manually every time, configure it as a systemd service.

Create a new service file:

sudo nano /etc/systemd/system/tomcat.service

Add the required Tomcat and Java environment variables, then save the file.

Afterward, reload systemd and start Tomcat:

sudo systemctl daemon-reload
sudo systemctl enable --now tomcat

Check whether the service is running correctly:

sudo systemctl status tomcat

If everything works properly, Ubuntu will display an active Tomcat service status.

Secure and Access Tomcat 10

To access Tomcat remotely, open port 8080 through the firewall:

sudo ufw allow 8080/tcp

Then open your browser and visit:

http://YOUR_SERVER_IP:8080

You should now see the Tomcat welcome page.

For better security, create administrative users inside the tomcat-users.xml file. Additionally, restrict remote dashboard access whenever possible. Production servers should never expose management panels publicly without proper protection.

Conclusion

Now you know how to Install Tomcat 10 on Ubuntu 22.04 and configure it for Java application hosting. With Java installed, firewall rules configured, and systemd integration enabled, your server is ready for development or deployment tasks.

Tomcat remains a reliable choice for modern Java workloads because it offers flexibility, stability, and simple management on Ubuntu systems.

Cyber Defence

Recent Posts

Install Pip on Ubuntu 18.04: Python 3 and Python 2 Setup Guide

Pip is the official package manager for Python and the standard way to install libraries from…

3 days ago

Install R on Ubuntu 18.04 from CRAN: Statistical Computing Setup

R is an open-source programming language and environment built for statistical computing and data visualization. It…

3 days ago

Install Jenkins on Ubuntu 18.04: CI/CD Server Setup Guide

Jenkins is an open-source automation server that makes it easy to build CI/CD pipelines. Continuous integration…

3 days ago

Install Android Studio on Ubuntu 18.04 with Snap and OpenJDK 8

Android Studio is the official IDE for Android development, built on JetBrains' IntelliJ IDEA platform. It…

3 days ago

Install and Configure GitLab on Ubuntu 18.04 with Omnibus

GitLab is a web-based, open-source Git repository manager written in Ruby. It includes built-in tools for…

3 days ago

Install Anaconda on Ubuntu 18.04: Python Data Science Setup Guide

Anaconda is the most widely used Python distribution for data science and machine learning. It bundles…

4 days ago