How To Install Apache Tomcat 8 on CentOS

Install Apache Tomcat 8 on CentOS

For those of you who didn’t know, Apache Tomcat is an open source web server and servlet container developed by the Apache Software Foundation. It implements the Java Servlet, JavaServer Pages (JSP), Java Unified Expression Language and Java WebSocket specifications from Sun Microsystems and provides a web server environment for Java code to run in. This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS.

Install Apache Tomcat 8 on CentOS

Step 1. JAVA is the first requirement of Tomcat installation.

CentOS 32 bit:

CentOS 64 bit:

Next, configure newly installed JAVA 8 files using command ‘alternatives‘, run the following series of commands on the terminal to configure Java.

You can also verify it, by issuing the following command.

Step 2. Download and extract Tomcat archive.

Once installing and configuring JAVA on the system, now it’s time to download latest version of Apache Tomcat.

Step 3. Add tomcat user and group.

Step 4. Configure Tomcat to run as a service.

You will get the following output.

You can verify the service running, by default tomcat runs on port no 8080.

Step 5. Finally, open Tomcat from your browser, go to your IP or domain with the 8080 port (because Tomcat will always run on the 8080 port) as an example:, replace with your IP or domain.

To shutdown Tomcat you can simply run the shutdown script in the same folder like this:

Step 6. Setup user accounts.

Configure Tomcat users so they can access admin/manager sections. You can do this by adding the users in the conf/tomcat-users.xml file with your favorite text editor. Add this text to the file:

Place the following two lines just above the last line.

Congratulation’s! You have successfully Apache Tomcat. Thanks for using this tutorial for installing Apache Tomcat 8 on CentOS system. For additional help or useful information, we recommend you to check the official Apache Tomcat web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!