Automatic Tomcat Startup in Windows Upon System Boot

  • Last update:September 30, 2025
  • Overview

    This document introduces how to configure Tomcat installed in Windows to start automatically upon system boot.

    iconNote:

    1. For details about how to configure Tomcat installed in Linux to start automatically upon system boot, see Automatic Tomcat Startup in Linux Upon System Boot.

    2. You can search online for the differences between the Tomcat ZIP distribution and EXE distribution.

    Tomcat ZIP Distribution

    This section takes the environment consisting of Windows 11, Tomcat 9.0.109, and JDK 1.8.0_332 as an example to demonstrate the settings.

    Method One

    Method one is adding the Tomcat startup program to the Startup folder in Start Menu, so that Tomcat can start automatically upon system boot.

    1. Press Win + R to open the Run dialog box, input shell:startup, and click OK to open the Startup folder of Start Menu, as shown in the following figure.

    2.1-1.jpg

    2. Go to Tomcat installation directory/bin, create a shortcut for the startup.bat file, and place the shortcut file in the Startup folder, as shown in the following figure.

    2.1-2.jpg

    Method Two

    Method two is registering the startup program of the Web application server as a system service. After the system boots, the server will start automatically without any foreground window.

    iconNote: 
    This method only supports Tomcat startup. If you need to stop the Tomcat service in Windows, you can run the shutdown.bat file in the path Tomcat installation directory/bin.

    Preparing the Tool

    Download the tool package Tool Package.zip, decompress the package, and place the decompressed files in a certain path. In this example, the two files are placed in the path C:\tools.

    2.2.1.jpg

    Registering as a Service

    You can register srvany.exe as a system service using instsrv.exe. The following briefly introduces how to use instsrv.exe.

    instsrv.exe allows you to register a Win32 program as a system service. Its command usage is as follows:

    instsrv [Service name] [Absolute path of srvany.exe]: Add a system service.

    instsrv [Service Name] REMOVE: Delete a system service.

    Press Win + R to open the Run dialog box, input cmd, and press Ctrl + Shift + Enter to open the cmd window as the administrator. In the cmd window, use the cd command to enter the folder where instsrv.exe is located, and then input the command instsrv FRServer C:\tools\srvany.exe, and press Enter, as shown in the following figure.

    iconNote: 

    You need to modify the path in the command as needed.

    2.2.2.jpg


    Adding the Startup Program to Services

    Create a FR.bat file in C:\tools to start the Tomcat server. The file content is as follows:

    C: cd "C:\apache-tomcat-9.0.109\bin" start startup.bat
    2.2.3-1.jpg

    Press Win + R to open the Run dialog box, input regedit, click OK to enter the Registry Editor window, and choose HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > FRServer.

    1. Select FRServer, right-click it, choose New > Key, and name the key Parameters.

    2. Select Parameters, right-click it, choose New > String Value, and name the string value Application.

    3. Double-click Application, and set Value data to C:\tools\FR.bat.‪

    2.2.3-2.jpg

    Starting the Service

    In Services, find the system service FRServer registered previously. The startup type of the service is Automatic. That is, the service starts automatically when the system boots. You can click Start to manually start the service, as shown in the following figure.

    2.2.4.jpg

     Tomcat EXE distribution

    This section takes the environment consisting of Windows 11, Tomcat 9.0.109, and JDK 1.8.0_332 as an example to demonstrate the settings. (You need to configure the JAVA_HOME environment variable in advance.)

    Configuration Step

    1. Checking the basic running status of Tomcat

    Starting Tomcat: Double-click startup.bat in the path Tomcat installation directory/bin, and check if any error is reported in Command Prompt.

    Testing access: Input http://localhost:8080 in a browser. The default Tomcat page should be displayed. If not, check for port conflict. (For example, port 8080 is occupied.)

    2. Registering Tomcat as a Windows service (if not automatically registered)

    Tomcat of the EXE distribution is usually registered as a system service automatically. If not, you can register it manually following the steps in this section.

    Go to Tomcat installation directory/bin, and find the service.bat file.

    Press Win + R to open the Run dialog box, input cmd, click OK to enter the cmd window, and drag the service.bat file into the window.

    Input a space and install tomcat, and press Enter. In this case, Tomcat is registered as a system service.

    iconNote: 

    1. If the error message "JAVA_HOME not defined" is displayed, check the JDK environment variable.

    2. If service names conflict, modify the service name tomcat in the command to a unique name (for example, Tomcat9-YourApp).

    3.1-1.jpg

    3. Setting the service startup type to Automatic

    Press Win + R to open the Run dialog box, input services.msc, and press Enter to enter Services.

    Find the Tomcat service, which is usually named Apache Tomcat [Version] or similar names (for example, Tomcat8).

    Right-click the service, select Properties, set Startup type to Automatic, click Apply, and click OK.

    3.1-2.jpg

    Service Deletion

    If you want to delete the service configured in the "Configuration Step" section, go to Tomcat installation directory/bin, find service.bat, open the Command Prompt window, drag service.bat into the window, input a space and remove tomcat, and press Enter. as shown in the following figure.

    3.2.jpg

    Notes

    Error 500

    Problem

    If you use the method in the "Tomcat EXE distribution" section to set the automatic server startup upon system boot, the error 500 may occur when you access the report project, as shown in the following figure.

    4.1.png

    Solution

    For details about resolving the problem, see modifying memory settings for installed Tomcat.

    Attachment List


    Theme: Deployment and Integration
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy