Neil Ang

Bersonal Plog

A stunning likeness of Neil Ang
Super Nerd

How to install Tomcat on Mac OS X

Posted on

A while back I wrote a post on the ubuntu forums on how to install Tomcat on ubuntu. It was very popular (if I do say myself) so I thought I would post the instructions on how to setup tomcat on Apple's OS X. These instructions work for 10.4 (Tiger), 10.5 (Leopard) and 10.6 (Snow Leopard).

Installing Tomcat

  1. Download the latest core binary distributions of tomcat from (do not download the windows service installer).
  2. Unzip the download and rename the folder from "apache-tomcat-x-x-xx" to something simple like "Tomcat".
  3. Move the folder to the root /Library directory (or somewhere else convenient). Tomcat is installed. That's it!
  4. To start tomcat run found in /Library/Tomcat/bin. To stop tomcat run found in the same bin directory. After starting tomcat navigate to http://localhost:8080 to see if the server is working.

Custom Tomcat Start/Stop Script

To make starting and stopping tomcat easier you can create a custom shell script to turn tomcat on and off through terminal.

Open up your favorite text editor (mine is TextMate) and add the following code:


case $1 in
    sh /Library/Tomcat/bin/
    sh /Library/Tomcat/bin/
    sh /Library/Tomcat/bin/
    sh /Library/Tomcat/bin/
    echo "Usage: start|stop|restart"

exit 0

Save the file with the title "tomcat" (in lowercase and no extension). Place the file in a bin directory which is included in your terminal's path e.g. /usr/bin. Now when you want to use tomcat, simply write "tomcat start" and "tomcat stop" in terminal.

Leave a comment if you have any suggestions, troubleshooting or ideas.