JIRA on EC2 Micro instance with Ubuntu and Postgres


  1. Click EC2
  2. Under “Create Instance”, click “Launch Instance”
  3. Scroll down to Ubuntu Server 13.10 (ami-ad184ac4) and select the 64 bit version
  4. Follow the rest of the steps to create the instance. Download the private key if you don’t already have one. Also you may need to chmod the key: chmod 0700 ~/Downloads/my-ec2-key.pem

Connect into the machine and set up a password

7. From a terminal, ssh -i ~/Downloads/my-ec2-key.pem ubuntu@ec2-internal-ip-address-domain.compute-1.amazonaws.com
8. Enable password authentication: sudo vim /etc/ssh/sshd_config, change PasswordAuthentication from no to yes
9. sudo reload ssh
10. Set a password: sudo passwd ubuntu

Download JIRA and install

11. mkdir downloads; cd downloads
12. Download JIRA. Here’s the version I used, you probably want the latest: wget http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-6.1.2-x64.bin
12. Make the installer executable chmod u+x atlassian-jira-6.1.2-x64.bin
13. sudo ./atlassian-jira-6.1.2-x64.bin
14. Run through the JIRA setup wizard, default locations are fine
15. curl http://icanhazip.com to get your external ip
16. curl -v http://<external-ip>:8080 should work at this point
(If not, check your AWS security group in the EC2 management console and allow traffic through port 8080.)

Install and configure Postgres

17. sudo apt-get install postgresql
sudo su – postgres
createuser -P jira
20. Answer no to superuser, yes to be allowed to create databases, no to being able to generate more roles
sudo su – jira
createdb jiradb`

Tweak JIRA

24. cd /opt/atlassian/jira/bin
25. sudo vim setenv.sh
(If running vim with sudo won’t let you write to the file, you may need to sudo chmod +w setenv.sh then sudo chmod -w setenv.sh after step 26.)
26. Modify in the appropriate places to end up with these lines


Create a swap file

27. sudo dd if=/dev/zero of=/var/swapfile bs=1M count=2048
28. sudo chmod 600 /var/swapfile
29. sudo mkswap /var/swapfile
30. echo /var/swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab
40. sudo swapon -a

At this point you’re getting pretty close to something that might work.

My advice is try sudo reboot and let the whole thing come back up again. Log in using your password you set on ubuntu. (You should no longer need the -i flag on the ssh command.)

Once you can ssh back into the system, give that curl -v http://<external ip>:8080 command another try.

If all goes well, fire up your web browser and try setting it up from there. Be aware that the first few loads of these pages may be slower than normal.

Browser config

41. Database config–this should be pretty straightforward, you’ll need to use the same username/database name/password as you set up already. Username should be jira, database name should be jiradb, default port 5432 should be fine. (It sets that when you select Postgres). You’ll need to set the hostname to localhost.
42. Choose the name of your instance. I chose the defaults for most all the other steps in the wizard.
43. Log in with an Atlassian account to create a trial license key. If you don’t have an account, you’ll need to create one.
44. If you see the System Dashboard page, all is well. You can adjust your time zone.

At this point you should have up and running JIRA on an EC2 micro instance with the latest Ubuntu, backed by Postgres. If not, hit me up in the comments and I’ll try to get you straightened out.

Leave a Reply