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.
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:
Before you begin, ensure your Ubuntu server has sudo privileges.
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.
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.
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.
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.
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.
Introduction Bash scripting is a powerful way to automate Linux tasks, but writing a script…
Introduction A self-signed SSL certificate is a certificate that is created and signed by the…
Introduction Debugging is an important part of Bash scripting. When a script does not work…
Introduction Cron jobs are used in Linux to run commands or Bash scripts automatically at…
Introduction Pipes are an important feature in Linux and Bash scripting. A pipe allows you…
Introduction The grep, awk, and sed commands are powerful text-processing tools in Linux. They are…