How to install tomcat 8 on Ubuntu/Debian

by Ismail.EL
0 comment


How to install tomcat 8 on Ubuntu/Debian

1. Introduction :

Apache Tomcat, often referred to as Tomcat, is an open-source web server developed by the Apache Software Foundation (ASF).
Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket,
and provides a “pure Java” HTTP web server environment for Java code to run in.

2. Verify JAVA :

Before you can use Tomcat, JAVA is the first requirement of Tomcat installation. First let’s check to see if Java is installed:

java version “1.8.0_66”
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

If that returns the following then Java hasn’t yet been installed:
The program ‘java’ can be found in the following packages:

3. Downloading Tomcat Archive :

Download Apache Tomcat 8 archive file using following commands or you can visit Tomcat 8 Downloads page for download most latest version (and copy the link to the “tar.gz”).
After downloading extract archive file in /opt directory.

First, move to /opt directory:[user@tutorials-space $] cd /opt[user@tutorials-space $] wget http://mirrors.ibiblio.org/apache/tomcat/tomcat-8/v8.0.30/bin/apache-tomcat-8.0.30.tar.gz[user@tutorials-space $] tar xzf apache-tomcat-8.0.30.tar.gz

4. Configure Environment Variables :

Before starting Tomcat, configure CATALINA_HOME environment variable in your system using following commands.

Restart the bash, to make the changes affective as:

5. Starting Tomcat :

Tomcat is very easy to use, There are no need to compile its source. You simple extract the archive and start the tomcat server.
Tomcat by default start on port 8080, So make sure no other application using the same port.

you will get the following output.Using CATALINA_BASE:   /opt/apache-tomcat-8.0.30
Using CATALINA_HOME:   /opt/apache-tomcat-8.0.30
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.30/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/apache-tomcat-8.0.30/bin/bootstrap.jar:/opt/apache-tomcat-8.0.30/bin/tomcat-juli.jar
Tomcat started.

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

tcp6       0      0 :::8080                 :::*                    LISTEN      4066/java

6. Access Tomcat in Browser  :

Tomcat server works on port 8080 default. Access tomcat on web browser by connecting your server on port 8080.
http://your_address_ip:8080 or  http://your_namesrever:8080

install apache8 on ubuntu

7. Setup User Accounts :

Finally we need to create user accounts to secure and access admin/manager pages.
Edit conf/tomcat-users.xml file in your editor and paste inside <tomcat-users> </tomcat-users> tags<user username=”USER1″ password=”PASSWORD_USER1″ roles=”manager-gui” />

access via the interface in the browser with the following link:

http://192.168.1.6:8080/manager
manage user in tomcat 8


And enter the username (USER1) and password (PASSWORD_USER1)

manage user tomcat 8 2

8. Conclusion

In this post, i have explained How to install tomcat 8 on ubuntu.
If you have any questions or feedback, feel free to leave a comment.
As always, if you found this post useful, then click like and share it 🙂

21570cookie-checkHow to install tomcat 8 on Ubuntu/Debian

Related Posts

Leave a Comment