Running the Atlassian Suite on My Mac

Recently our Atlassian TAM stopped by for his quarterly visit. We had a very productive discussion, and I remarked that both he and his colleague were using Macs with Confluence and JIRA running natively despite the lack of "official" support. I was happy to hear that most of the engineering team are Mac users as well, and that while it's not a production-worthy setup1 it's regularly used by many Atlassians.

I, on the other hand, was activley running both in separate ubuntu VMs in Parallels2. This setup works, but I incur a relatively high memory/CPU penalty, as well as the nutso overhead of resuming a VM, syncing the local clock each time, etc. It's silly just to test something out.

There are no decent, authoritative guides out there on the Interwebs, so I thought I'd publish one myself. Your mileage may vary. I'm (still) running OS X 10.9 Mavericks, so I can't guarantee these steps will work on Yosemite3. In addition, while you don't need to install MySQL as you may opt to use the local HSQL for both applications, I like being able to use the mysql client to see the data I'm using, and this makes it closer to my production setup.

Step 1: Install a compatible JVM

Presuming you only have the default version of Java 6 (1.6.0_65) at /Library/Java/Home, go download the latest Java 7 or Java 8 SDK from Oracle.4 Install it, then set its path as your JAVA_HOME environment variable. I use oh-my-zsh, so I added this to my .zshrc:

1
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home

Step 2: Install MySQL

I wanted to use homebrew as much as possible, so rather than download the branded installer, I did the following:

1
2
3
4
% brew update
% brew upgrade
% brew install mysql
% mysql.server start

Then, run the commands that Homebrew suggests to add MySQL to launchctl so it automatically launches at startup. These are most of the same instructions for Mavericks at coderwall, which worked flawlessly without the cleanup steps.5

Next, follow the Database Setup For MySQL guide, step 2, #2 to edit your my.cnf file. Then restart mysql.

After it restarts, log in and set up the DB users you will need later. Open mysql as root6:

1
% mysql -uroot

...and run the following SQL:

1
2
3
4
5
CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;
CREATE DATABASE jira CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON confluence.* TO 'confluenceuser'@'localhost' IDENTIFIED BY 'confluencepass';
GRANT ALL PRIVILEGES ON jira.* TO 'jirauser'@'localhost' IDENTIFIED BY 'jirapass';
flush privileges

Step 3: Download the MySQL Connector

You need this for both applications, so go grab the latest platform-independent connector here and unpack it somewhere handy. I chose ~/Downloads.

Step 4: Prepare A Home

You will need both an installation location as well as a home directory7 for each application:

1
2
3
4
5
% cd /var
% sudo mkdir atlassian
% sudo chown mattshelton:staff atlassian
% sudo chmod g+w atlassian
% mkdir -p atlassian/jira/home atlassian/confluence/home

Step 5: Install JIRA

There is a guide for Installing JIRA on Mac OS X from Atlassian. It reads like the generic install overview was almost, kinda, updated for the Mac, but there are still sections like this:

If your operating system is *nix-based (for example, Linux or Solaris), type the following in a console:
$ sudo /usr/sbin/useradd --create-home --comment "Account for running JIRA" --shell /bin/bash jira
If your operating system is Windows: ...

Here's what I did:

Download and Unpack JIRA

  1. Download the JIRA tar.gz file here.
  2. Unzip the downloaded file. In my case, I unpacked it in /var/atlassian/atlassian-jira-6.3.13-standalone and created a symlink called current in the same directory. That way, JIRA is always installed at /var/atlassian/jira/current, and when I upgrade I always know where it is and I can keep the previous application directory around in case I need to grab customized files.

Set JIRA Home

This is identical to what is in the above Atlassian guide8:

  1. Go to /var/atlassian/jira/current/atlassian-jira/WEB-INF/classes/.
  2. Edit the file jira-application.properties and set the value of jira.home to /var/atlassian/jira/home.

Database Configuration

Since you already created the database itself, all you need to do is tell JIRA how to connect to it:

  1. In /var/atlassian/jira/current/bin, run config.sh. This opens up a little swing app with a bunch of configuration options.
  2. In the second tab, configure the database as needed. You can test it from the same tab and save your settings once you have a working database connection.
  3. Copy the MySQL Connector into the JIRA lib directory:
1
$ cp ~/Downloads/mysql-connector-java-5.1.34/mysql-connector-java-5.1.34-bin.jar /var/atlassian/jira/current/atlassian-jira/WEB-INF/lib/.

Start JIRA

From /var/atlassian/jira/current/bin:

1
2
$ ./start-jira.sh
$ tail -f ../logs/catalina.out

Once you see that the server has started, open http://localhost:8080/ and run the setup wizard.

Step 6: Install Confluence

This section is what inspired me to write this post in the first place. Unlike JIRA, there is no "Installing Confluence on Mac OS X" page. The steps, though, are nearly identical to JIRA, and are roughly the same as the guide from the Confluence 3.4 documentation (written in 2010):

Download and Unpack Confluence

  1. Download the Confluence Standalone tar.gz file here.
  2. Unzip the downloaded file. In my case, I unpacked it in /var/atlassian/atlassian-confluence-5.6.5 and created a symlink called current in the same directory. That way, Confluence is always installed at /var/atlassian/confluence/current, and when I upgrade I always know where it is and I can keep the previous application directory around in case I need to grab customized files..

Configure Confluence Environment

  1. Go to /var/atlassian/confluence/current/confluence/WEB-INF/classes/.
  2. Edit the file confluence-init.properties and set the value of confluence.home to /var/atlassian/confluence/home.
  3. Copy the MySQL Connector into the Confluence lib directory:
1
$ cp ~/Downloads/mysql-connector-java-5.1.34/mysql-connector-java-5.1.34-bin.jar /var/atlassian/jira/current/confluence/WEB-INF/lib/.

Start Confluence

From /var/atlassian/confluence/current/bin:

1
2
$ ./start-confluence.sh
$ tail -f ../logs/catalina.out

Once you see that the server has started, open http://localhost:8090/ and run the setup wizard. The setup wizard includes the data source configuration. Unlike JIRA, there is a web-based tool to specify this rather than a swing app.

Of note, the standalone installer also include some handy Mac OS Terminal command files in the bin directory, presumably so that you could have some shortcut icons to start/stop Confluence.

Conclusion

I chose to let Confluence use JIRA as its user directory to make this a one-stop shop as I expect I'll always have both running. I'm saving myself ~4GB of memory without the VMs and there's no spinning fan noise, which is a giant plus.

I titled this "Running the Atlassian Suite on my Mac", but I have no intention of installing the other applications just yet. I'll post again if I do.


  1. Ths is due to the relative lack of production hardware running MacOS, not the lack of production-worthiness of the OS itself.

  2. Not because this is the only option, but because the last time I tried to install each of them on my Mac it was a dismal failure.

  3. They should. Some of the steps I figured out from comments in other posts from Yosemite users.

  4. Account Required. Welcome to the new order.

  5. I should note, though, that homebrew now runs the last few commands specified in the guide as a part of the installation. I had very little to do to get an instance running quickly.

  6. The initial mysql password for root when installing from homebrow is empty. It might be wise to set one.

  7. Most guides will tell you to run each application as a dedicated user. This is unnecessary and overcomplicates the installation.

  8. Note that you can skip this step and specify the JIRA home in the config tool, then have it reload itself, all within the swing app. It works both ways.

Jan 17th, 2015

Comments