Automatic Tomcat Startup in Windows Upon System Boot

  • Last update:June 25, 2025
  • Overview

    This document introduces how to configure Tomcat installed in Windows to be automatically started up upon system boot.

    iconNote:

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

    2. You can search the internet for the differences between the Tomcat portable and installer versions.

    Tomcat Portable Version

    This section takes the Windows 11 Pro, Tomcat 9.0.106, and JDK1.8.0_66 as an example environment.

    Method One

    This method is used to add the Tomcat startup program to the Startup folder in Start Menu for automatic startup upon system boot.

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

    1.png

    2. Enter the bin directory in Tomcat installation directory, create a shortcut for the startup BAT file, and place the shortcut file into the Startup folder, as shown in the following figure.

    2.png

    Method Two

    This method is used to register the startup program of the Web application server as a system service. After the system boots up, the server will start up automatically without any foreground running window.

    iconNote:
    This method only supports Tomcat startup. If you need to stop the Tomcat service, you can start the shutdown BAT file in the bin directory of Tomcat installation directory (Windows system).

    Tool Preparation

    Download the tool package Tool Package.rar, decompress the package, and place the files obtained after decompression into a certain path. In this example, the two files are placed into D:\bb\Tool_Package.

    3.png

    Service Registration

    You can register the srvany EXE file as a system service by the instsrv EXE tool. The following briefly introduces how to use the tool.

    The instsrv EXE tool enables you to register the Win32 program as a system service by the following commands:

    • instsrv [Service Name] [Absolute path of the srvany EXE file]: Add a      system service.

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

    Press Win + R, and run cmd as the administrator. In the cmd window opened after cmd running, enter the directory where the stsrv EXE file is located by the cd command. Enter instsrv FRServer D:\bb\Tool_Package\srvany.exe, and press Enter, as shown in the following figure.

    iconNote: 
    You need to modify the path in the command according to actual needs.

    4.png

    Adding the Startup Program for the Service

    Create a FR.bat file in D:\bb\Tool_Package to start the Tomcat server. The file content is as follows:

    D: cd "D:\apache-tomcat-9.0.106\bin" start startup.bat

    5.png

    Press Win + R, enter regedit in the Run dialog box, and click OK to enter the Registry Editor window. 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 ‪D:\bb\Tool_Package\FR.bat.

    6.png

    Service Startup

    In Services, find the system service FRServer registered previously. The startup type of the service is Automatic. That is, the service automatically starts up upon system boot. Just select the service and click Start to start the service, as shown in the following figure.

    7.png

    Tomcat Installer Version

    This section takes Windows 11 Pro, Tomcat 9.0.106, and JDK1.8.0_66 as an example environment. (You need to configure the JAVA_HOME environment variable in advance.)

    Configuration Procedure

    1. Checking the basic running state of Tomcat

    Tomcat startup: Double-click the startup BAT file in Tomcat installation directory/bin, and check whether any error is reported by the console.

    Access test: Open http://localhost:8080 in the browser, and check whether the default Tomcat page is displayed. If the default page is not displayed, check whether any port conflict exists. (For example, the port 8080 is occupied.)

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

    Generally, Tomcat of the EXE installer version is registered as a system service. If it is not registered, you can register it as a service by referring to this section.

    • Enter the bin directory in Tomcat Installation directory, and find the service BAT file.

    • Press Win + R, enter the cmd window, and drag the service BAT file into the window.

    • Enter a space, enter 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).

    8.png

    3. Setting the service startup type to Automatic

    Press Win + R, enter services.msc, and press Enter to enter the Services page.

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

    Right-click the service, select Properties, modify the startup type to Automatic, click Apply, and click OK.

    9.png

    Service Deletion

    If you want to delete the service configured in section "Configuration Procedure", enter the bin directory in Tomcat installation directory, and find the service BAT file. Open the Command Prompt window by the cmd command, drag the service BAT file into the window, enter a space, enter remove tomcat, and press Enter, as shown in the following figure.

    10.png

    Notes

    Error 500

    Problem

    If you use the method in section "Tomcat Installer Version" 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.

    11.png

    Solution

    For details, see Modifying FineBI Configuration Parameters.

    附件列表


    主题: Deployment and Integration
    Previous
    Next
    • 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