Start Confluence Automatically on Windows as a Service
For long-term use, we recommend that you configure Confluence to start automatically when the operating system restarts. For Windows servers, this means configuring Confluence to run as a Windows service.
There are two ways to install the Confluence distribution as a service: using the Confluence installer or manually as described below.
On this page:
Reasons for Starting Confluence as a Service
Installation as a Windows service offers these advantages:
- Reduced risk of shutting down Confluence by accident (If you start Confluence manually, a console window opens and there is a risk of someone accidentally shutting down Confluence by closing the window).
- Automated Confluence recovery after server restart.
- Improved troubleshooting through logging server output to file.
You can read more about Windows services in the Microsoft Developer Network.
Changing the User Running the Service
If you wish to run the service as a non-administrator user for security, or if you are using network drives for backups, attachments or indexes, you can run the service as another user. To change users, open the Apache Tomcat Confluence properties, go to the 'Log On' tab and enter the required username and password. Go to your Windows Control Panel -> User Accounts and confirm that the user has write permissions for the <CONFLUENCE-INSTALL> and <CONFLUENCE-HOME> directories, and all subfolders. Note that any network drives must be specified by UNC and not letter mappings (eg.
For more detail, see Creating a Dedicated User Account on the Operating System to Run Confluence.
Manually Installing the Confluence Distribution as a Service
From your Windows-based server:
- Open a command prompt in the
Confirm that the JAVA_HOME variable is set to the JDK base directory with the command:
Note that any directory in the path with spaces (eg.
C:\Program Filesmust be converted to its eight-character equivalent (e.g.
- If you are installing Confluence on a Windows 2008 server, be sure to run the command prompt using 'run as administrator'. (Otherwise running 'service.bat', as described in the next step, will fail.)
Use the following command to install the service with default settings:
NB: This will create a service called Apache Tomcat Confluence.
Now, to have the service start automatically when the server starts, run:
(if you are using a different version of tomcat, specify your tomcat version, e.g.
If you have a less than a 1024 megabytes of memory, skip this step. For users with large Confluence installations, you can increase the maximum memory Confluence can use. (The default is 1024MB). For example, you can set the maximum memory to 2048 megs using:
If you do not have any JVM parameters that you pass to your distribution of Confluence, you can skip this step. If you do, add them to the service using:
- For further configuration options, please refer to the Tomcat Windows Service How-To guide
- Go to your Windows Control Panel -> Administrative Tools -> Services -> Apache Tomcat Confluence and right-click on Properties to verify the settings are correct.
Confluence is now installed as a service, but will not automatically start up until the next server reboot
Start the Confluence service with the command:
Managing Confluence as a Service
You can manage the Confluence service from the command prompt.
Stop Confluence with:
Uninstall the Confluence service with:
After upgrading Confluence, you can either uninstall and reinstall the Windows service or change the StartPath parameter to your new folder. Refer to the Tomcat documentation for help.
Troubleshooting Confluence while Running as a Windows Service
- Check the Knowledge Base articles:
- If none of the above solves your problem, please refer to the complete list of known issues in our Knowledge Base.
When investigating memory issues or bugs, it may be useful to view information from Confluence's garbage collection. To turn on the verbose garbage collection, use the command:
- The Confluence 2.9 installer does not work when installed as service, due to a missing semi-colon in
service.bat. Please refer to reported issue CONF-12785.
You can use a Sysinternals tool called
Procmon.exefrom the The Microsoft Windows Sysinternals Team, to check that the error occurred at the specific time when the Confluence service started. You need to match the time when Tomcat failed, as captured by this tool, against the time in the Windows Event Viewer.
If, after following the troubleshooting guide above, you still cannot make Confluence run as a Windows Service or if there is an error when setting the JVM configuration for the service, you can create a support request.
Please provide the following information when creating your support request, because we will need it to assist you:
- Are you running a 32 bit or 64 bit Windows?
- Give us the result of running
java -versionfrom Windows command line console.
- A screen shot of your Windows Registry setting for Tomcat.
- If you have modified service.bat, please give us a copy of this file for review.
- What application server are you using? eg. Are you using the Confluence distribution?
- Your atlassian-confluence.log file.
Was this helpful?
Thanks for your feedback!