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

git fetch vs git pull: How They Work and When to Use Each

Both git fetch and git pull talk to a remote repository, but they do very different things to your…

3 days ago

git cherry-pick Command: Apply Commits from Another Branch

Sometimes the change you need already exists, just on the wrong branch. A hotfix lands…

3 days ago

Best Email APIs for Secure Business Email: Why Developers Are Moving Beyond SMTP

Email is still one of the most important communication channels inside modern applications. Password resets,…

4 days ago

Nginx Commands in Linux: Start, Stop, Reload, Test, and Log

Nginx is a high-performance web server and reverse proxy trusted by some of the largest…

7 days ago

ufw Command in Linux: Manage Firewall Rules with Examples

ufw (Uncomplicated Firewall) sits on top of iptables (or nftables on newer systems) and replaces…

7 days ago

who Command in Linux: Show All Logged-In Users and Sessions

When you share a server with a team or investigate unexpected activity, the first question…

7 days ago