Install or Configure Tomcat as a Windows service

Profile picture for user devraj

Apache Tomcat installs several Java Enterprise Edition specs including Java Servlet, JavaServer Pages, Java EL, and WebSocket. It provides for a “pure Java” HTTP web server environment in which Java code can run.

Tomcat's Windows service is included with all the actively supported Windows-specific distributions of Tomcat, including a lightweight package aimed at users who intend to use Tomcat exclusively as a Windows service, which does not include the standard Tomcat start-up scripts.

Installing Tomcat as a service is very easy. In fact, if you used the Windows installer program to install Tomcat on your system, Tomcat has already been installed as a service automatically.

Benefits of running Tomcat as a Windows service

Running Tomcat as a Windows Service provides a number of benefits that are essential when moving from a development set-up to a production environment.

These include:

  • Reliable automatic startup on boot: essential in an environment where you may want to remotely reboot a system after maintenance without worrying about whether your server will come back online.
  • Server startup without active user login: In a data center, it is not reasonable to expect an active login from the system just to run Tomcat. In fact, Tomcat is often run on blade servers that may not even have an active monitor connected to them. Windows Services are owned by the System, and can be started without an active user.
  • Security: If you run Tomcat as an administrator, a vulnerability in one of your web applications can open up your whole server to attack. Running Tomcat as a Windows Service allows you to run it under a special system account, which is isolated and protected from rest of the user accounts.