Apache Tomcat 8 Installation on Ubuntu 14.04

posted on Nov 20th, 2016

Apache Tomcat

Apache Tomcat, often referred to as Tomcat, is an open-source Java Servlet Container 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 in which Java code can run.

Tomcat is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation, released under the Apache License 2.0 license, and is open-source software.

Pre Requirements

1) A machine with Ubuntu 14.04 LTS operating system installed.

2) Apache Tomcat 8 software (Download Here)

Apache Tomcat 8 Installation

The following steps to install tomcat on your machine.

Installation Steps

Step 1 - Installing java 7. Open a terminal (CTRL + ALT + T) and type the following sudo command.

$ sudo apt-get install openjdk-7-jdk

Check it installed properly or not.

$ java -version

Step 2 - Creating tomcat directory. Open a terminal (CTRL + ALT + T) and type the following $ sudo command.

$ sudo mkdir /usr/local/tomcat

Step 3 - Change the ownership and permissions of the directory /usr/local/tomcat. Here 'hduser' is an Ubuntu username.

$ sudo chown -R hduser /usr/local/tomcat

$ sudo chmod -R 755 /usr/local/tomcat

Step 4 - Change the directory to /home/hduser/Desktop , In my case the downloaded apache-tomcat-8.0.30.tar.gz file is in /home/hduser/Desktop folder. For you it might be in /downloads folder check it.

$ cd /home/hduser/Desktop/

Step 5 - Untar the apache-tomcat-8.0.30.tar.gz file.

$ tar xzf apache-tomcat-8.0.30.tar.gz

Step 6 - Move the contents of apache-tomcat-8.0.30 folder to /usr/local/tomcat

$ mv apache-tomcat-8.0.30/* /usr/local/tomcat

Step 7 - Edit $HOME/.bashrc file by adding the java and catalina path.

$ sudo gedit $HOME/.bashrc

$HOME/.bashrc file

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export CATALINA_HOME=/usr/local/tomcat

Step 8 - Reload your changed $HOME/.bashrc settings

$ source $HOME/.bashrc

Step 9 - Change the directory to /usr/local/tomcat/bin


Step 10 - Starting the tomcat web server.

$ ./startup.sh

Step 11 - Check the web here. Open a browser and type the following URL.

Step 12 - Stoping the tomcat web server.

$ ./shutdown.sh

Please share this blog post and follow me for latest updates on

facebook             google+             twitter             feedburner