Overview
This document introduces how to configure Tomcat installed in Windows to start automatically upon system boot.
Note: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. 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.

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.
Note: 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.

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.
Note: You need to modify the path in the command as needed.

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
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.

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.

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.
Note: 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. 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.

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.

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.

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