How to install Apache Tomcat on Ubuntu 18.04


Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing Apache Tomcat on Ubuntu 18.04

Apache Tomcat is an open-source web server and servlet container that is used to serve Java-based web applications. It provides an environment to run Java code and serve dynamic content over the web.

Step 1: Update Package Manager

Before installing Apache Tomcat, it is recommended to update the package manager to ensure that you have the latest software versions. Open a terminal and execute the following command:

sudo apt update

Step 2: Install Java Development Kit (JDK)

Tomcat requires Java Development Kit (JDK) to run. You can install OpenJDK, which is an open-source implementation of the Java SE platform. Execute the following command in the terminal:

sudo apt install default-jdk

Step 3: Download and Extract Apache Tomcat

Visit the official Apache Tomcat website (https://tomcat.apache.org) and download the latest stable version of Tomcat. Alternatively, you can use the following command to download it directly from the terminal:

wget https://downloads.apache.org/tomcat/tomcat8/v8.5.63/bin/apache-tomcat-8.5.63.tar.gz

Extract the downloaded file using the following command:

tar -xf apache-tomcat-8.5.63.tar.gz

Step 4: Move Tomcat Directory

Move the extracted Tomcat directory to a desired location. For example, you can move it to the /opt directory:

sudo mv apache-tomcat-8.5.63 /opt/tomcat

Step 5: Configure Environment Variables

To access Tomcat globally, you need to set up environment variables. Open the .bashrc file in your preferred text editor:

nano ~/.bashrc

Add the following lines at the end of the file:

export CATALINA_HOME="/opt/tomcat" export PATH="$PATH:$CATALINA_HOME/bin"

Save the file and exit the text editor. To apply these changes, execute the following command or restart the terminal:

source ~/.bashrc

Step 6: Start Tomcat Server

You can now start the Tomcat server by executing the following command:


To verify if Tomcat is running, open a web browser and enter the following URL:


If the Tomcat server is running correctly, you should see the default Tomcat homepage.

Step 7: Stop Tomcat Server

To stop the Tomcat server, open a terminal and execute the following command:


That's it! You have successfully installed Apache Tomcat on Ubuntu 18.04.

Refer A Friend
Get $25

Apache Tomcat
Ubuntu 18.04
Apache Tomcat installation
Tomcat installation
Apache Tomcat 9
Tomcat 9 install
Ubuntu Apache Tomcat
Apache Tomcat setup
Tomcat on Linux

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.