Back to Blog
Backend Development
November 4, 2025
Fahim Hossain

Installing Apache Tomcat on MacOS Mojave using Homebrew

In order to install Apache Tomcat on MacOS, we firstly need to install Java Development Kit(JDK).

In order to install Apache Tomcat on MacOS, we firstly need to install Java Development Kit(JDK). To check if java installed, open up the terminal and run the following command:

java -version

If the JDK is not installed, then you will be prompted with the following message

No Java runtime present, requesting install.

On the other hand, if JDK is installed, you will be promoted a message which will look similar to the following:

openjdk version “12.0.220190716
OpenJDK Runtime Environment (build 12.0.2+10)
OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)

Installing JDK on Mac OS using Homebrew

(If JDK is installed on your system, then please skip to the next section.)

Please make sure Homebrew package manager is installed on your system. For instructions to install Homebrew please read the official documentation here.

Step 1: Install Homebrew Cask

Homebrew Cask extends Homebrew and allows you to install large binary files via the Mac terminal. JDK can be installed onto your Mac using Homebrew Cask.

In order to install Homebrew Cask, please type in the following commands onto the terminal sequentially

brew update
brew tap caskroom/cask

Step 2: Install JDK with Homebrew Cask

Run the following command to install the latest version of JDK onto your system:

brew cask install java 

Now, please check if Java is installed on your system by running the following command:

java -version

You will be promoted a message which will look similar to the following:

openjdk version “12.0.220190716
OpenJDK Runtime Environment (build 12.0.2+10)
OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)

Installing and Running Apache Tomcat on Mac OS using Homebrew

Step 1: Install Apache Tomcat

Run the following commands on the terminal in order to install Apache Tomcat:

brew update
brew install tomcat

Step 2: Run Apache Tomcat

Apache Tomcat can be run on Mac OS in two separate ways.

1. Start Tomcat automatically at Mac Login:

brew services start tomcat

In order to stop Tomcat to start automatically at Mac Login:

brew services stop tomcat

2. Start Tomcat manually:

catalina start

In order to stop Tomcat manually:

catalina stop

To view available options on Tomcat run:

catalina -h

Thats it!

I hope this article has been to some aid to you. Would really love to hear from you!

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript