Installation and Starting of Tomcat Server (original) (raw)

Last Updated : 5 Aug, 2025

Before you start installing Apache Tomcat, it’s important to ensure that your system meets the requirements for a smooth installation and setup process.

**1. Hardware Requirements

2. Operating System Compatibility

Apache Tomcat is cross-platform and runs on any system that supports Java. Recommended OS options include:

**3. Java Environment

A Java installation is required to run Tomcat. Use the Java Development Kit (JDK) for full functionality:

**1. Java Version: JDK 8 or newer (JDK preferred over JRE)

**2. Environment Variables:

export JAVA_HOME=/path/to/jdk
export PATH=$JAVA_HOME/bin:$PATH

**Verify Java:

java -version

4. Network Requirements

Ensure the following ports are open and accessible for Tomcat to function properly:

5. Software Prerequisites

In addition to Java, Tomcat may depend on:

**1. JDBC Drivers: Required for database connectivity if your applications interact with a database

6. Additional Tools

To enhance your Tomcat setup and maintenance, consider installing:

Tomcat Installation on Windows

The following are the steps that help in guiding how to install Apache Tomcat in Windows and set up its environment:

**Step 1: Download Tomcat

First, you have to download the Windows Service Installer from their official website using the Windows Tomcat Binary Distribution.

Downloading binary app

**Step 2: Run the Installer

Launch the installer. A setup wizard will open, guiding you through the installation process.

Tomcat-Installation

**Step 3: Accept License and click next

You can accept the license and click on next button.

Agree Installation

**Step 4: Configure Installation Options

You will be asked to provide:

Step 5: Click "Next" → "Install" → "Finish"

Then click the next, then install, and finally Finish.

Finish Installation

**Step 6: Verify Tomcat Installation

Open your browser and go to "**http://localhost/8080".

http://localhost:8080

Managing Tomcat Server on Windows

To manually **start, **stop, or **restart the Apache Tomcat server on a Windows system, follow these steps:

**Default Installation Path

If you installed Tomcat using the default installer, the directory path is usually:

C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin

Steps to Start/Stop/Restart the Server

**Step 1: Navigate to the bin Directory

Open File Explorer and go to:

C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin

bin tomcat folder

**Step 2: Locate the Tomcat Executable

Look for the file named:

Tomcat9.exe

**Step 3: Stop the Server

**Step 4: Start or Restart the Server Again

start-stop server

Tomcat Installation on Linux

The following steps guide you through installing Apache Tomcat on a Linux system:

**Step 1: Install Java

Install Java (if not already installed) using the following command in the terminal.

sudo apt update

**Step 2: Install the default JDK

Install the default JDK (Java Development Kit) with the following command execution.

sudo apt install default-jdk

**Step 3: Verify the Installation

Verify whether the Java is installed or not by using the below command.

java -version

Java (jdk) setupUp

Setting up a Tomcat User

The following steps guide you on how to setup the tomcat user:

**Step 1: Create a Tomcat User

Create a new user with the new user name with useradd command as follows:

sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat

**Step 2: Download the Tomcat Package

Downloading the Tomcat package with the below command:

wget -c https://downloads.apache.org/tomcat/tomcat-9/v9.0.87/bin/apache-tomcat-9.0.87.tar.gz

After downloading extract the file with tar command as follows:

sudo tar xf apache-tomcat-9.0.87.tar.gz -C /opt/tomcat

**Step 4: Navigate and Inspect

You can change the directory and list the content

cd /opt/tomcat
ls -ls

Chanage the directory of tomcat

Starting and Managing Tomcat from the bin Directory

The following steps help in changing the bin directory of tomcat:

**Step 1: Switch to root

Change to root user

sudo su

**Step 2: Navigate to the bin directory

Change directory

cd /opt/tomcat/apache-tomcat-9.0.87/bin/

Tomcat Started

**Step 3: Start the server

Start Tomcat using either of the following commands

sh startup.sh
OR
./startup.sh

**Step 4: Test in browser

Open your browser and go to:

http://localhost:8080/

Server at localhost

**Step 5: Stop Tomcat

To stop the server, run:

./shutdown.sh

Stop Server

Applications of Apache Tomcat Server

The following are the some of the common applications of the tomcat server:

**1. Web Hosting for Java Applications

**2. Embedded Servers

**3. Commonly used for enterprise applications involving

**4. Web Applications Deployment

Troubleshooting Common Issues with Tomcat Server

The following are the some common Tomcat server troubleshooting techniques:

**1. Checking Log Files

**2. Validating Configuration Files

**3. Monitoring Resource Usage

**4. Diagnosing Network Issues