Hey! We're going to install Stash on Windows. There are a few steps, but we think you'll really like Stash once it's up and running.
If you are installing Stash for production or enterprise use, first check the additional steps at the bottom of this page and read Using Stash in the enterprise.
Better check the Supported platforms page first; it lists the application servers, databases, operating systems, web browsers and Java versions that we have tested Stash with and recommend.
Atlassian only officially supports Stash running on x86 hardware and 64-bit derivatives of x86 hardware.
2. Check your version of Java
In a command prompt, run this:
The version of Java should be 1.7.x (Java 1.8 is not supported yet).
If you don't see Java 1.7.x then get Java...
Download Java Server JRE from Oracle's website, and install it (note that Java 1.8 is not supported by Stash yet).
Now try running 'java -version
' again to check the installation. The version of Java should be 1.7.x.
3. Check that Windows can find Java
Stash uses the JAVA_HOME environment variable to find Java. To check that, in a command prompt, run:
You should see a path to the root directory of the Java installation. When running Stash on Windows, unlike Linux or Unix, JAVA_HOME
paths with spaces are just fine.
If you don't see a path...
If you don't see a path, or if you just see %JAVA_HOME%, then set JAVA_HOME as follows:
Windows Server 2003 R2 ...
Stage 1. Locate the JRE Installation Directory
If you already know the installation path for the Java Runtime Environment, go to Stage 2 below. Otherwise, find the installation path by following these instructions:
- If you didn't change the installation path for the Java Runtime Environment during installation, it will be in a directory under
C:\Program Files\Java
. Using Explorer, open the directory C:\Program Files\Java
. - Inside that path will be one or more subdirectories such as
C:\Program Files\Java\
jre7
.
Stage 2. Set the JAVA_HOME Variable
Once you have identified the JRE installation path:
- Right-click the My Computer icon on your desktop and select Properties.
- Click the Advanced tab.
- Click the Environment Variables button.
- Under System Variables, click New.
- Enter the variable name as JAVA_HOME.
- Enter the variable value as the installation path for the Java Development Kit. Don't use a trailing backslash, and don't wrap the value in quotes.
- Click OK.
- Click Apply Changes.
- Close any command window which was open before you made these changes, and open a new command window. There is no way to reload environment variables from an active command prompt. If the changes do not take effect even after reopening the command window, restart Windows.
Now, in a new command prompt, try running '%JAVA_HOME%\bin\java -version
'. You should see the same version of Java as you saw in 2. above.
Windows 7 ...
Stage 1. Locate the JRE Installation Directory
If you already know the installation path for the Java Runtime Environment, go to Stage 2 below. Otherwise, find the installation path by following these instructions:
- If you didn't change the installation path for the Java Runtime Environment during installation, it will be in a directory under
C:\Program Files\Java
. Using Explorer, open the directory C:\Program Files\Java
. - Inside that path will be one or more subdirectories such as
C:\Program Files\Java\
jre7
.
Stage 2. Set the JAVA_HOME Variable
- Go to Start, search for "sys env" and choose Edit the system environment variables.
- Click Environment Variables, and then New under 'System variables'.
- Enter "JAVA_HOME" as the Variable name, and the absolute path to where you installed Java as the Variable value. Don't use a trailing backslash, and don't wrap the value in quotes.
Now, in a new command prompt, try running '%JAVA_HOME%\bin\java -version
'. You should see the same version of Java as you saw in 2. above.
4. Check your versions of Git and Perl
In a command prompt, run:
git --version
perl --version
The version of Git should be 1.7.6 or higher. The version of Perl should be 5.8.8 or higher.
If you don't see supported versions of Git and Perl, then get them...
Download the Full installer for official Git for Windows. Installing Git for Windows (msysGit) also installs a supported version of Perl.
Run the Git installer. Ensure that git.exe is available in the path:
- Option 2, "Run Git from the Windows Command Prompt", or Option 3, "Run Git and included Unix tools from the Windows Command Prompt", will both work with Stash.
- Do not select Option 1, "Use Git Bash only" -- this will not work with Stash.
Now, in a new command prompt, try running 'git --version
' again. The version of Git should be 1.7.6 or higher.
msysGit is the only supported distribution when running Stash on Windows. Cygwin Git is not supported and has known issues.
5. Now it's time to get Stash
Download Stash from the Atlassian download site. Looking for the Stash WAR file?
Extract the downloaded file to an install location. The path to the extracted directory is referred to as the <Stash installation directory>
in these instructions.
Note that you should use the same user account to both extract Stash and to run Stash (in Step 7.) to avoid possible permission issues at startup. Don't use spaces in the path to the Stash installation directory.
6. Tell Stash where to store your data
The Stash home directory is where your Stash data is stored.
Create your Stash home directory, and then tell Stash where you created it by setting a STASH_HOME
environment variable, as follows.
For Windows 7:
- Go to Start, search for "sys env" and choose Edit the system environment variables.
- Click Environment Variables, and then New under 'System variables'.
- Enter "
STASH_HOME
" as the Variable name, and the absolute path to your Stash home directory as the Variable value. Don't use a trailing backslash.
There are a few things to know about setting up the Stash home directory on Windows that will make life easier:
- You should not locate your Stash home directory inside the
<Stash installation directory>
— they should be entirely separate locations. If you do put the home directory in the <Stash installation directory>
it will be overwritten, and lost, when Stash gets upgraded. And, by the way, you can't use the same Stash home directory for multiple instances of Stash. - Keep the path length to the Stash home directory as short as possible. See Stash always shows incorrect Merge Conflict in PRs for an explanation.
- Don't use spaces in the path to the Stash home directory.
7. Start Stash!
The user that runs Stash should not have admin privileges (see this performance issue), but must have read, write and execute access to the Stash home directory and the <Stash installation directory>.
In a command prompt, change directory to the <Stash installation directory>
and run the following command:
In your browser, go to http://localhost:7990 and run through the Setup Wizard. In the Setup Wizard:
8. Set up your mail server
Configure your email server so users can receive a link from Stash that lets them generate their own passwords. See Setting up your mail server.
9. Add users and repositories
Now is the time to set up your users in Stash, and to tell Stash about any existing repositories you have. Please the following pages for the details:
Additional steps for production environments
For production environments we recommend that you configure the additional aspects below. These are not necessary when installing for evaluation purposes. Please see Using Stash in the enterprise for more information about best practice.
Install and run Stash as a dedicated user
Use an external database
Secure the Stash home directory
- For production environments the Stash home directory (created in step 7 above) should be secured against unauthorised access. See Stash home directory.
Secure Stash with HTTPS
- For production environments access to Stash should be secured using HTTP over SSL, especially if your data is sensitive and Stash is exposed to the internet. See Securing Stash with Tomcat using SSL.
Run Stash as a Windows service
Connect to your existing user directory
Change the context path for Stash
- Where y ou are running Stash behind a proxy, or you have another Atlassian application, or any Java web application, available at the same hostname and context path as Stash, then you should set a unique context path for Stash. See Moving Stash to a different context path.
Stopping Stash (optional)
In a command prompt, change directory to the <Stash installation directory>
and run:
Uninstalling Stash
To uninstall Stash, stop Stash as described above and then delete the <Stash installation directory
> and Stash home directory.