Installing Tomcat 10 on Ubuntu 24.04
Below is a step-by-step guide to install Apache Tomcat 10 on Ubuntu 24.04.
Prerequisites
- An Ubuntu 24.04 system (server or desktop)
- Administrative (sudo) privileges
- Java Development Kit (JDK) installed (Tomcat requires Java 17+)
Step 1: Update the System
sudo apt update
sudo apt upgrade
Update your server’s package repository and make sure the system is up to date[1][2].
Step 2: Install Java
Install OpenJDK, as Tomcat requires Java to run:
sudo apt install openjdk-17-jdk
Verify Java installation:
java -version
You should see output that includes openjdk version "17" or newer[1][3].
Step 3: Create a Dedicated Tomcat User
For better security, it’s recommended to run Tomcat as its own user.
sudo useradd -m -d /opt/tomcat -U -s /bin/false tomcat
This creates a system user and group named tomcat[1][2].
Step 4: Download and Extract Tomcat
Get the latest Tomcat 10 release from the Apache website. Always check for the latest stable release.
wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.1.25/bin/apache-tomcat-10.1.25.tar.gz -P /tmp
sudo mkdir /opt/tomcat
sudo tar -xvf /tmp/apache-tomcat-10.1.25.tar.gz -C /opt/tomcat --strip-components=1
- Replace the URL and version with the current latest version as needed[1][2].
Step 5: Set Permissions
Change ownership to the Tomcat user and group:
sudo chown -R tomcat:tomcat /opt/tomcat
Grant the Tomcat group access to the conf directory:
sudo chmod -R g+r /opt/tomcat/conf
sudo chmod g+x /opt/tomcat/conf
Step 6: Create a systemd Service File
Create a tomcat.service file to manage Tomcat with systemd:
sudo nano /etc/systemd/system/tomcat.service
Paste the following content:
[Unit]
Description=Apache Tomcat 10 Web Application Container
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
Environment="JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
- Save and exit.
Step 7: Start and Enable Tomcat
Reload systemd and start Tomcat:
sudo systemctl daemon-reload
sudo systemctl start tomcat
sudo systemctl enable tomcat
Step 8: Verify Installation
Open a browser and visit:
http://:8080
You should see the Tomcat welcome page if everything was set up correctly[2].
Notes:
– For production, secure Tomcat by adjusting the admin users and changing default passwords.
– If you encounter a 403 Access Denied error, check the conf/tomcat-users.xml file for proper permissions[4].
This process will reliably set up Tomcat 10 on your Ubuntu 24.04 system for Java application deployment[1][2][3].
[1] https://www.fosstechnix.com/how-to-install-tomcat-on-ubuntu-24-04-lts/
[2] https://www.server-world.info/en/note?os=Ubuntu_24.04&p=java&f=5
[3] https://doc-new.digdash.com/xwiki/wiki/dd2024r2/view/Digdash/deployment/installation/install_guide_ubuntu/Ubuntu24/
[4] https://www.hostmycode.in/tutorials/how-to-install-apache-tomcat-10-on-ubuntu
[5] https://docs.vultr.com/how-to-install-apache-tomcat-on-ubuntu-24-04
[6] https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-10-on-ubuntu-20-04
[7] https://www.layerstack.com/resources/tutorials/how-to-install-apachetomcat-on-ubuntu24
[8] https://www.youtube.com/watch?v=pL7A7DWgEzA
[9] https://launchpad.net/ubuntu/noble/+package/tomcat10
[10] https://www.youtube.com/watch?v=coCgS7Y4cK4
[11] https://www.youtube.com/watch?v=BjTeVqjVRuQ
[12] https://www.youtube.com/watch?v=Jucdcq9hgZQ
[13] https://www.youtube.com/watch?v=15hRYg5nnFs
[14] https://www.youtube.com/watch?v=TNZuqEglH9Y
[15] https://www.youtube.com/watch?v=7i0wj2QYo4M
[16] https://www.youtube.com/watch?v=HcHbWsZZtpg
Exercise
- Setup apache server and enable php
- Install glassfish
