Installing Atlassian Stash on a Headless Ubuntu Server

Today’s post relates to my experience installing Atlassian Stash on a headless Ubuntu box. My first attempt ended with me trying all sorts of nonsense which left the server messy as hell, including an accidental installation of Unity…

The trickiest part for me was the installation of Java as the version available via the package manager, OpenJDK, didn’t seem to play ball with Stash. No idea why but one of the helpful fellows from Atlassian, Stefan Saasen, pointed me in the right direction with this article which I’ve used as basis for the steps below, the browser plugin steps were omitted for obvious reasons.

First of all you need to grab the tar file for Java from here then get it onto your server, the easiest way I found was to use an FTP application in SSH file transfer mode. Then connect to the terminal and run through these commands;

Decompress the tar file noting that the file name will reflect the version you download and may differ from mine;
tar -xvf jdk-7u2-linux-x64.tar.gx

If you are installing on a fresh server, that should be all you need for Java to work. If you’ve a few JVMs present on your machine, see the original article for steps to configure the default. For Stash, you can now follow the instructions here. One thing I found quite useful was the wget command that a colleague showed me, it makes downloading via the terminal quite easy, getting the Stash installer for example can be done like so;
wget http://www.atlassian.com/software/stash/downloads/binary/atlassian-stash-2.3.1.tar.gz

For editing the setenv.sh file, and text files in general, I’ve found nano really useful. I’ve not ventured into the murky depths of the text editor holy war yet but this does the trick for now. I had to run the same chmod against the Stash home directory I created but after that I was good to go. Open a browser to the path listed in the console and use the wizard to continue setup.

Thank you very much for this. After flogging Gitolite around for a few days, I finally came to the realization that all I really needed to do was get Stash onto my Ubuntu Server box. This post was extremely helpful, especially with the Java crap. I should ask, though… why go through the FTP/SSH stuff at all, when we have wget?

Thank you for the article, I believe that it is easier to use automated deployment services for such installation, especially if you need it in the cloud. Deploy4Me supports Stash. SO, the full server configuration is just a matter of a few clicks.https://deploy4me.com/en/install/stash.html