Skip to content
Follow
Ubuntu Linux

How to Install Tomcat 11 on Ubuntu 24.04

Richard
Written by
Richard
Feb 28, 2025 Updated Jul 13, 2026 5 min read
How to Install Tomcat 11 on Ubuntu 24.04
How to Install Tomcat 11 on Ubuntu 24.04

Apache Tomcat 11 on Ubuntu 24.04 is a web server and container for Java applications.

It helps you run websites and web programs written in Java. This guide shows you how to install Tomcat 11 on Ubuntu 24.04, starting with downloading the right files.

You’ll need to set up a couple of important system settings, like telling Tomcat where Java is installed. This is a key step for Tomcat to work correctly.

The process involves downloading the Tomcat software, setting up your system’s Java environment, and then starting the Tomcat service so you can access it.

⚡ Quick Answer

Install Tomcat 11 on Ubuntu 24.04 by downloading the binary distribution, creating a system user, setting up a systemd service file, and starting the Tomcat service. Access the web portal at your server’s IP address on port 8080.

Install Java Runtime Environment

Tomcat is a Java application that requires installing Java on the system. If you don’t already have Java installed, read the post below to install it.

Install Java Runtime Environment on Ubuntu

After installing Java on Ubuntu, continue to install Tomcat.

Download Tomcat packages

You need to download the correct Tomcat 11 packages from the official Apache Tomcat website to install Tomcat 11 on Ubuntu 24.04. Make sure you get the latest available version of the binary code. This step gets the core software ready to install on your system.

Make sure the latest version and source from the download site.

Since we’re installing Tomcat version 11, download the 11 binary code using the command below.

💻Code
curl -O https://dlcdn.apache.org/tomcat/tomcat-11/v11.0.4/bin/apache-tomcat-11.0.4.tar.gz

After downloading the file, extract the downloaded file.

💻Code
tar zxvf apache-tomcat-11.0.4.tar.gz
⚠️Warning
Then, move downloaded file to the [/usr/libexec/tomcat11]. This will be the working directory of the Tomcat user we will create below.
🐧Bash / Shell
sudo mv apache-tomcat-11.0.4 /usr/libexec/tomcat11

Create Tomcat user

Creating a dedicated user account for Tomcat on Ubuntu 24.04 is a smart security move. This new user will run Tomcat with its own specific permissions, keeping it separate from your main system account. This helps to isolate Tomcat and improve your server’s security.

Run the command below to create the Tomcat user with home directory of the extracted Tomcat packages.

The second command ensures the Tomcat user is the owner of the directory.

🐧Bash / Shell
sudo useradd -M -d /usr/libexec/tomcat11 tomcat
sudo chown -R tomcat:tomcat /usr/libexec/tomcat11

Create system service

Making Tomcat 11 a system service on Ubuntu 24.04 lets you manage it easily using common commands to start and stop it. You create a special service file for this purpose. This setup ensures Tomcat starts automatically when your computer restarts, keeping your application running.

Run the command below to create a system service file for Tomcat.

🐧Bash / Shell
sudo nano /usr/lib/systemd/system/tomcat11.service

Then, copy and paste the content below into the file.

💻Code
[Unit]
Description=Apache Tomcat 11
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/libexec/tomcat11/bin/startup.sh
ExecStop=/usr/libexec/tomcat11/bin/shutdown.sh
RemainAfterExit=yes
User=tomcat
Group=tomcat

[Install]
WantedBy=multi-user.target

Save and exit the file.

Next, enable the service.

🐧Bash / Shell
sudo systemctl enable --now tomcat11
sudo systemctl restart tomcat11

Access Tomcat web portal

You can access the Tomcat 11 web portal on your Ubuntu 24.04 server once it’s installed and running. Open your web browser and go to your server’s IP address or hostname, followed by port 8080. This is the standard way to check if Tomcat is working and reach its management pages.

You can access the Tomcat portal using the server IP address or hostname followed by port 8080 to manage your Tomcat 11 installation on Ubuntu 24.04.

http://srv1.example.com:8080

Tomcat web portal
Tomcat web portal

Tomcat is installed and ready.

⚠️Warning
To access the server manager, you will need an account and password.

You can create one by opening the configuration file below.

🐧Bash / Shell
sudo nano /usr/libexec/tomcat11/conf/tomcat-users.xml

Then, copy and paste the code below in the file, just before the </tomcat-users>.

💻Code
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="admin" password="type_new_password_here" roles="manager-gui,admin-gui"/>
</tomcat-users>

Save the file and exit.

To access the Tomcat server remotely, you must allow the remote IP address. To change IP address restrictions on these files, open the appropriate context.xml files.

Server Manager app:

🐧Bash / Shell
sudo nano /usr/libexec/tomcat11/webapps/manager/META-INF/context.xml

Host Manager app:

🐧Bash / Shell
sudo nano /usr/libexec/tomcat11/webapps/host-manager/META-INF/context.xml

Add the IP address you want to access remotely in the highlighted area.

💻Code
<Context antiResourceLocking="false" privileged="true" >
<!--<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127.d+.d+.d+|::1|0:0:0:0:0:0:0:1|new_public_ip_address_here" />-->
</Context>

Save and close the files, and you’re done!

That should do it!

Conclusion:

In summary, installing Apache Tomcat 11 on Ubuntu 24.04 is a straightforward process that involves several key steps:

  • Java Requirement: Ensure the Java Runtime Environment is installed before setting up Tomcat.
  • Downloading Tomcat: Obtain the latest Tomcat 11 binary package from the official Apache website.
  • User Creation: Create a dedicated system user for Tomcat to enhance security and manageability.
  • System Service Setup: Configure Tomcat as a system service for easy management and automated start on boot.
  • Accessing the Portal: Use the server’s IP address to access the Tomcat web portal at port 8080.
  • Security Configuration: Set up user roles and permissions for the Tomcat server to manage access effectively.

You can successfully install and configure Tomcat 11, making the Java web server ready to deploy your Java web applications. Installing Tomcat 11 allows you to run web programs written in Java.

How to run Tomcat 11?

Okay so by default the Apache 11 server is running next in order to test this go to the browser. And in a new tab just type localhost. And then port 8000 hit Enter.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
How to Install Additional Software on Ubuntu
Ubuntu Linux How to Install Additional Software on Ubuntu
How to Install Apache Solr on Ubuntu Linux
Ubuntu Linux How to Install Apache Solr on Ubuntu Linux
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *