How To Install Tomcat 9 on Ubuntu 18

In this tutorial, you will learn how to install tomcat 9 on Ubuntu 18. Tomcat is an Open Source container (Java servlet) which is developed by the Apache Software Foundation.

Tomcat Provides a “pure java“ http web server environment for running Java codes. Tomcat also implements Java servlet, JavaServer Pages (JSP), Java EL ad websocket.

Pre-requisites for installation Tomcat 9 on Ubuntu 18

Update the Ubuntu 18 repository index

Tomcat requires Java JDK to run, so it should be installed on the machine. Either you can install Oracle JDK or OpenJDK.

Check the Java Version on the machine and if it is not installed then you can install it with following steps.

Apache Tomcat 9 version support jaJava and later version

Steps to install Java Version 9 on Ubuntu 18 / Linux

In this tutorial, we will show you how to install OpenJDK.

Once Java package is installed on Ubuntu verify he Java version.

Now create tomcat user on Ubuntu it is best practice to run tomcat service with a non-root user.

Steps to create Tomcat Service user Account

As per best practice, you should NOT run Tomcat as a privileged user (root). So, create a user with low-privilege for running the Tomcat service.

Steps to download & configure Apache Tomcat for Ubuntu 18

Browser and Download Apache Tomcat 9


Extract download tomcat 9

Change the ownership of the extracted tomcat directory and allow tomcat user to write files to it.

Above output shows Java 1.8 version is installed on the machine.

Add the below details to tomcat system service file.

Command to started tomcat service in Ubuntu

Command to check the status of tomcat in Ubuntu

Command to Auto Start Tomcat service on boot in Ubuntu 18

Command to verify Apache Tomcat and the port on which service is running

Allow Tomcat port in Firewall, so that users can access the application from the external network.

Now, Configure Tomcat Web UI (User Interface)

In Tomcat we have web-manager and Host Manager for managing Tomcat and both are password protected, and it requires a username and password to access.

Add below lines in tomcat-users.xml

To access web and host managers from the remote system, add your source network in the allow list.

Update the below line in “tomcat-users.xml”with source IP from which your accessing the web and host Manager. .*

There is option to allow you network only instead of single. For example: To allow network only

Restart the Tomcat service on Ubuntu 18

Access Tomcat on the web browser:


Once you access tomcat on the web browser you will get Tomcat default page, This confirms your tomcat is properly installed on machine.

Web Manager: – Login Required. Username: admin, Password: password

In this article, you learned how to Install Tomcat 9 on Ubuntu 18.

Related Articles

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Adblock Detected

Please consider supporting us by disabling your ad blocker
%d bloggers like this: