Stash is now known as Bitbucket Server.
See the

Unknown macro: {spacejump}

of this page, or visit the Bitbucket Server documentation home page.

Hey! We're going to install Stash on a Linux box, or a Mac. There are a few steps, but we think you'll really like Stash once it's up and running.

1. Check supported platforms

Better check the Supported platforms page first; it lists the application servers, databases, operating systems, web browsers and JDKs 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 Java

Have you got the version of Java that Stash needs?

  • In a terminal, run this:

    java -version
  • The version of Java should be 1.6.0 or higher.

  1. Download and install the Java Platform JDK (not the JRE) from Oracle's website.
  2. Now try running 'java -version' again to check the installation. The version of Java should be 1.6.0 or higher.

3. Check JAVA_HOME

Does the system know where to find Java?

  • In a terminal, run this:

    echo $JAVA_HOME
  • You should see a path like /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/.

If you don't know what your Java home directory is try running the command which java in your terminal.

LinuxMac

Do either of the following:

  • If JAVA_HOME is not set, log in with 'root' level permissions and run:
echo JAVA_HOME="path/to/JAVA_HOME" >> /etc/environment

where path/to/JAVA_HOME may be like: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/

  • If JAVA_HOME needs to be changed, open the  /etc/environment file in a text editor and modify the value for JAVA_HOME to:

    JAVA_HOME="path/to/JAVA_HOME"

    It should look like:

    JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/


Insert the following in your ~/.profile file:

JAVA_HOME="path/to/JAVA_HOME"
export JAVA_HOME

where path/to/JAVA_HOME may be like: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/

Refresh your ~/.profile in the terminal and confirm that JAVA_HOME is set:

source ~/.profile
$JAVA_HOME/bin/java -version

You should see a version of Java that is 1.6.0 or higher, like this:

java version "1.6.0_24"

4. Check Git

Have you got the version of Git that Stash needs?

  • In a terminal, run this:

    git --version
  • The version of Git should be 1.7.6 or higher.

  1. Download and install the latest stable Git release from the Git website.
  2. Now try running 'git --version' again. The version of Git should be 1.7.6 or higher.

Please note the following:

  • See the Git resources page for links to more Git download sites.
  • At the time of writing, the default Git version on Ubuntu Linux is 1.7.5.x, which is too old for Stash: see https://launchpad.net/~git-core/+archive/ppa.
  • At the time of writing, on Mac OS X, the Git tar archive can fail on special characters when using SSH to secure connections between your computer and Stash. (The Git archive command allows you to download as a single file the files in a checkout of the Git repository.) We recommend that you use the zip format; you can set that using the following command:

    git archive --format zip

5. Get Stash

Now we're getting somewhere!

  1. Download Stash from the Atlassian download site.
  2. Extract the downloaded file to an install location. The path to the extracted directory is referred to as <Stash installation directory> in these instructions.

6. Set STASH_HOME

Tell Stash where to store your data.

  • (warning) 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.
  • Edit the file <Stash installation directory>/bin/setenv.sh, uncomment the STASH_HOME line and add the absolute path to your home directory. Here's an example of what that could look like when you're done:

7. Connect to an external database (optional)

  • If you already have a database you want to use, now is the time to tell Stash about it, before starting Stash for the first time. If you try to do this later, you'll lose data. See Connecting Stash to an external database. Just so you know, we're working on database migration for a future version of Stash.

 

  • If you do nothing about this now, Stash will happily use its internal database.

8. Start Stash!

  1. In a terminal, change directory to <Stash installation directory>/bin/ and run this:

    start-stash.sh
  2. In your browser, go to http://localhost:7990 and run through the Setup Wizard.
    You can postpone setting up JIRA integration until later if you wish; see Configuring JIRA integration in the Setup Wizard.

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

10. Secure Stash (optional)

  • Configure access to Stash, using HTTP over SSL, if your data is sensitive and Stash is exposed to the internet. See Securing Stash with HTTPS.

11. Stop Stash (optional)

  • In a terminal, change directory to <Stash installation directory>/bin/ and run this:

    stop-stash.sh
  • No labels