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:
If you are running 64-bit Windows, please note that you may encounter problems with Apache Tomcat running as a Windows service if you are using a 64-bit JDK. Refer to our knowledge base article for more information. |
Installation as a Windows service offers these advantages:
You can read more about Windows services in the Microsoft Developer Network.
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. \\backupserver\confluence not z:\confluence).
For more detail, see Creating a Dedicated User Account on the Operating System to Run Confluence.
From your Windows-based server:
<CONFLUENCE-INSTALL>/bin directory.Confirm that the JAVA_HOME variable is set to the JDK base directory with the command:
echo %JAVA_HOME% |
Note that any directory in the path with spaces (eg. C:\Program Files must be converted to its eight-character equivalent (e.g. C:\Progra~1).
Use the following command to install the service with default settings:
service.bat install Confluence |
NB: This will create a service called Apache Tomcat Confluence.
Now, to have the service start automatically when the server starts, run:
tomcat7 //US//Confluence --Startup auto |
(if you are using a different version of tomcat, specify your tomcat version, e.g. tomcat6)
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:
tomcat7 //US//Confluence --JvmMx 2048 |
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:
tomcat7 //US//Confluence ++JvmOptions="-Djust.an.example=True" |
Start the Confluence service with the command:
net start Confluence |
You can manage the Confluence service from the command prompt.
Stop Confluence with:
net stop Confluence |
Uninstall the Confluence service with:
service.bat remove Confluence |
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.
Starting Confluence Automatically on System Startup
Fix java.lang.OutOfMemoryError in Confluence