Manjaro Linux

How to install Apache Tomcat server on Manjaro Linux

Apache Tomcat(also known as Tomcat) is an open-source cross-platform support of Java servlet and Java Server Page container to implement an array of enterprise Java applications. The Java servlets are the tiny Java programs that define how the server handles the requests and responses. The developer allows tomcat to conduct all the routing and back-end work.

Tomcat is one of the leading projects at Apache Software Foundation and according to an estimate, the download count is more than 10 million. With the evolution of Java programs, the Apache tomcat has also gained heights of popularity and this fame can be verified by its use case in leading data centers across the globe.

Tomcat provides a cross-platform availability that allows users of Windows and macOS to use it. Moreover, it is open source as well, making it suitable for Linux-based systems as well.

Following the importance of this beneficial tool, we have compiled a procedural demonstration that guides on how to install the Apache Tomcat server on Manjaro Linux.

How to install Apache Tomcat on Manjaro Linux

The Apache Tomcat can be installed on Manjaro using the command line as well as the graphical interface of Manjaro. This section describes both methods to get tomcat for your Manjaro system.

How to install Apache Tomcat on Manjaro using command line interface

Before going for tomcat installation, make sure you have supported Java installed on your Manjaro system. The Apache Tomcat versions are 9.0.x and 10.0.x support Java 8.0 or later. Moreover, you can click here to get the supported Java version against each Tomcat release. Currently, the stable release of Tomcat is 10.0.12, so for this, we need Java 8.0 or later versions. The first step here refers to the installation of OpenJDK on Manjaro.

Step 1 : Firstly, synchronize and update the packages database by providing the command written below.

$ sudo pacman -Syu

Text Description automatically generated

The command written below will install the latest version of OpenJDK (Java Development Kit that is required for the development of Java programs).

$ sudo pacman -S jre-openjdk-headless jre-openjdk jdk-openjdk openjdk-doc openjdk-src

Text Description automatically generated

The command line support of Manjaro allows you to get the latest version of tomcat from the project’s site.

Step 2 : After getting JDK, the following command will download the tomcat-10.0.12 from the official project’s site.

$ wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.0.12/bin/apache-tomcat-10.0.12.tar.gz

Text Description automatically generated

After the download, check the md5 authentication method or authentication of the key provided by tomcat. To do so use the below-mentioned command :

$ md5sum apache-tomcat-10.0.12.tar.gz

Step 3 : Once the authentication step is performed, you can now extract the downloaded tomcat by the following command :

$ tar xvzf apache-tomcat-10.0.12.tar.gz

Text Description automatically generated

After that, it is recommended to perform some configuration steps that are necessary to run the tomcat server.

Firstly change the user and group of the tomcat directory. To do so, we have executed the following commands.

$ sudo chown -R root:root ~/apache-tomcat-10.0.12

$ sudo chmod -R +xr ~/apache-tomcat-10.0.12

Once the above steps are performe, you can now start/stop the Tomcat server on Manjaro Linux.

Start/Stop Tomcat server on Manjaro Linux

After setting the permission and ownership, you can start the tomcat server by issuing the following command.

$ sudo ~/apache-tomcat-10.0.12/bin/startup.sh

You can observe that the Tomcat server has been started. After that, you can access the web interface of tomcat by using the localhost:8080 webaddress in your favorite browser.

$ http://localhost:8080

Graphical user interface, website Description automatically generated

Note: It is noticed that if tomcat is not running, you cannot access the web.

Moreover, you can stop the tomcat server by executing the following command.

$ sudo ~/apache-tomcat-10.0.12/bin/shutdown.sh

How to install Apache Tomcat on Manjaro using graphical interface

The tomcat is available on the official repository of Manjaro and you can install it from “Add/Remove Software” support of Manjaro and the steps are mentioned here.

Step 1 : Click on the shield icon (refers to package manager) placed on the top bar of Manjaro (GNOME Desktop Environment), and then navigate to “Package Manager“.

A screenshot of a computer Description automatically generated with medium confidence

Note : This step can be carried out in other desktop environments of Manjaro by searching for “Add/Remove Software“.

Step 2 : After that, move to “Search” icon placed on the menu bar as can be seen in the image below.

Graphical user interface, application Description automatically generated

Search for tomcat. The search result contains multiple versions of tomcat. Click on the latest stable version that is tomcat10.

Graphical user interface, application Description automatically generated

Click on the Install button and then navigate to Apply to start getting things ready for installation.

Graphical user interface, website Description automatically generated

Step 3 : Now, click on Choose to get the list of dependencies.

Graphical user interface, text, application Description automatically generated

Authenticate yourself by providing your password.

A screenshot of a computer Description automatically generated with low confidence

As we are installing tomcat10, for that JDK version 8 or greater is required. You may choose any verison but it is suggested to go with the latest available.

Text Description automatically generated

The following window contains the list of packages/dependencies that will be installed. Click on Apply to move forward.

Graphical user interface, application Description automatically generated

The installation will be completed after a few moments.

Graphical user interface, text Description automatically generated

Here you go, you are finally done with the installation of the tomcat on Manjaro.

Conclusion

Tomcat is an open-source service to run Java code by providing a web server environment . In this article, you would have learned to install Tomcat on the Manjaro Linux. This guide provides command line and graphical support to get Tomcat on Manjaro Linux. Graphical interface installation provides support to get JDK with tomcat, however, you have to install JDK separately while following the command line process. Alongside the installation, we have provided a preliminary configuration that is required to run the Tomcat on Manjaro Linux.

About the author

Adnan Shabbir