---
title: "How to Install Apache Tomcat 8 on Ubuntu"
description: "Apache Tomcat (sometimes referred to as simply Tomcat) is a popular open-source web server software used to set up Java-based server environments. The technologies used in Tomcat include Java..."
url: https://www.inmotionhosting.com/support/edu/software/how-to-install-apache-tomcat-8-on-ubuntu/
date: 2020-06-30
modified: 2021-10-20
author: "InMotion Hosting Contributor"
categories: ["Software"]
type: post
lang: en
---

# How to Install Apache Tomcat 8 on Ubuntu

Apache Tomcat (sometimes referred to as simply Tomcat) is a popular open-source web server software used to set up Java-based server environments. The technologies used in Tomcat include Java Servlet, Java Server Pages, Java Expression Language, and WebSocket and provides an HTTP server environment ideal for running Java-based applications. Apache Tomcat can be installed on most popular operating systems such as Ubuntu and [CentOS](https://www.inmotionhosting.com/support/edu/software/how-to-install-apache-tomcat-on-centos-7/). In this article, we will outline how to install Apache Tomcat 8 on your Ubuntu server. Please note, in order to complete the steps in this guide you will need to ensure you have [root SSH access](https://www.inmotionhosting.com/support/amp/obtain-root-access/).

Topics Include: 

- [Installing Apache Tomcat](#install)
- [Testing Apache Tomcat](#test)

Install Apache Tomcat 8 on your [Dedicated Hosting](https://www.inmotionhosting.com/dedicated-servers) server and start running your Java applications today!

## Installing Apache Tomcat

1. First, you will need to **make (mkdir)** a Tomcat folder and **change directory** **(cd)** into it using the following commands:mkdir /opt/tomcatcd /opt/tomcat
2. Next, you will **download the Apache Tomcat archive file** and then **extract the archive** using the following commands:wget tomcat.tar.gztar -xvzf tomcat.tar.gz
3. Then, ensure that Java is installed with the following command:java -versionIf Java is not installed, you must first [install it](https://www.inmotionhosting.com/support/product-guides/vps-hosting/install-java-on-centos/) before proceeding.
4. Then, you will need to **configure your .bashrc file** and **set the environment variables**. To do this, you will use the **nano text editor** to modify the .bashrc file using the following command:****nano ~/.bashrc 
5. Add the following lines to the bottom of the .bashrc file:export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64export CATALINA_HOME=/opt/tomcat/apache-tomcat-8.5.32 
6. Press **Ctrl + X** to save the file and exit the nano text editor.
7. Register the changes to the .bashrc file with the following command:~/.bashrc

## Testing Apache Tomcat 

1. Before testing to see if Tomcat was set up successfully, **run the startup script** with the following command:$CATALINA_HOME/bin/startup.sh
2. If the installation was successful, you can **visit your server IP** followed by :8080 and you should see a Tomcat splash page. 

Congratulations, you have successfully installed Apache Tomcat!
