Tomcat Server running as Windows service

English: Logo of Русский: Логотип Apache Tomcat

How to install service for Tomcat 6.x/7.x to start automatically after reboot on Windows 7 or Windows Server 2008?

First of all you will need administration privileges to install service. This step by step guide is for standalone zip version of Tomcat Server.

  1. Navigate to bin folder of your tomcat installation. You should have in folder three files among others: service.bat, tomcat7.exe and tomcat7w.exe. If you are using older Tomcat Server than these files should be tomcat6.exe and tomcat6w.exe.

    service.bat tomcat7.exe 
    tomcat7w.exe
  2. If these files are not there then you have to manually add them. First figure out which version of Tomcat you have. Also define architecture 32 bit/64 bit.
    After that go to http://tomcat.apache.org/download-70.cgi or http://tomcat.apache.org/download-60.cgi and download the right zip file.
    If you are using older versions than you have to look in
    http://archive.apache.org/dist/tomcat/tomcat-7/ or
    http://archive.apache.org/dist/tomcat/tomcat-6/ for zip file.
  3. In downloaded zip navigate to Tomcat bin directory and copy service.bat, tomcatX.exe and tomcatXw.exe. files to your Tomcat installation. You can remove downloaded zip now ;).
  4. Stop Tomcat Server if running.
  5. Open cmd with Administrator privileges and navigate to Tomcat’s bin directory where you should now have all three files.
  6. Run service.bat install. Your service should be installed with name Tomcat7 or Tomcat6.
    Following instructions can be found here: http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html.
  7. After that run tomcatXw.exe //ES//(X is Tomcat major version) A new window should pop up.
    tomcat7w.exe //ES//

  8. The next step is important for successful running Tomcat with Windows service.
    Increase “Initial memory pool” and “Maximum memory pool”.
  9. Add new line “Java Options” section. This will increase Java heap size. This setting is very important as running Tomcat as service will override all other settings except those.
    -XX:MaxPermSize=256m

  10. Start Tomcat as a service in Windows Services. Run services.msc or access it from Tak Manager (Services tab).
This way you can automatically run Tomcat Server after reboot without logged in user.
Advertisements

7 Replies to “Tomcat Server running as Windows service”

  1. Hi. You said:
    “3.In downloaded zip navigate to Tomcat bin directory and copy service.bat, tomcatX.exe and tomcatXw.exe. files to your Tomcat installation”.
    But I have tomcat6w.exe and tomcat6.exe. What could I have done wrong ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s