[Other doc versions]
We recommend that you use the Stash installer to install Stash as a service on Windows. It installs Stash as a service and creates items in the Windows 'Start' menu for starting and stopping Stash – see Getting started.
The information on this page only applies if you are manually installing or upgrading Stash from an archive file. See Install Stash from an archive file.
For long-term use on a Windows server, Stash should be configured to run as a Windows service. This has the following advantages:
System administration tasks are not supported by Atlassian. These instructions are only provided as a guide.
If you are using a 64-bit version of Windows, first ensure that Stash uses a 64-bit JVM (check by running
java -version in a Command Prompt, and ensure that the
JAVA_HOME system environment variable points to the 64-bit JVM), and then replace the 32-bit Tomcat binaries with their 64-bit counterparts in the
<Stash installation directory>/bin directory:
JAVA_HOMEvariable is set to the root of your Java platform's installation directory.
JAVA_HOMEcannot contain spaces, so the default Java installation directory of C:\Program Files\Java won't work.
Stash installation directory>. See Git push operations extremely slow on Windows.
setenv.batare ignored. Ensure that you have set
STASH_HOMEas a system environment variable, before running the
The information in this section only applies if you are manually installing Stash as a Windows service. Alternatively, you can use the Stash installer for Windows to install Stash as a service – see Running the Stash installer.
To run Stash as a Windows service:
STASH_HOMEas the Variable name and the absolute path to your Stash home directory as the Variable value. Don't use a trailing backslash. Note that the Stash home directory should not be located inside the
<Stash installation directory>. You must do this step before running the
service.batscript in Step 5 below.
binsubdirectory. If a directory in the path has spaces (e.g.
C:\Program Files\..), use its eight-character equivalent (e.g.
Run the following commands:
This will create a service with the name "AtlassianStash" and a display name of "Atlassian Stash". If you would like to customize the name you can instead run:
This will create the service as "MyName" with a display name of "Atlassian Stash MyName".
Run the following command to increase the amount of memory that Stash can use (the default is 768 Mb):
Here is an example:
service.bat installin a Command Prompt running as an Administrator.