Creating a Relativity Server AMI from Scratch for AWS

To make it easy to host Relativity Server in Amazon Web Services, we provide a ready-to-use AMI that you can just pick and boot up, as explained in Setting up Relativity Server on AWS‎.

That said, there might be reasons for you to want to create your own image from scratch (for example to have 100% control and governance of what goes into the image), or to add Relativity Server to an existing EC2 instance. For this reason, we are documenting the steps that we use to generate this default image, below.

Terminal commands assume you are using a UNIX system, such as Mac OS X or Linux. On Windows, you may need to use a third party SSH client, such as PuTTY.

The following steps go through setting up an image using Ubuntu Linux. If you prefer, you can also host Relativity Server on a Windows image, but there is little benefit to that, and Windows EC2 instances will be more costly to run.

Note: Once again, these are not steps you will normally need to take care of yourself, if you use the provided images.

  1. Create a new VM instance using the Ubuntu Server image provided by Amazon, by clicking the Launch Instance button in your EC2 console. (We use the "general purpose" instance).
  2. Continue via the Next: Configure Instance Details button.
  3. Accept the defaults until the step (6), unless you know what you need to change.
  4. On step (6), add a rule allowing access on port 7099 (the default Relativity Server port).
  5. Complete the Wizard by pressing Launch.
  6. When prompted, generate a new key pair in the popup window and store the downloaded .pem file safely.*
  7. Finally, start the instance.
  8. Wait until it fully initializes and starts.
  9. Connect to the instance using the following command ssh -i /path/to/keyfilename.pem ubuntu@ip-address-here where the IP address (or host name) can be obtained in the EC2 console and /path/to/keyfilename.pem is the key file you downloaded earlier. Note: If the SSH connection fails with an error that the .pem file is "accessible by others", you can change its access permissions by running chmod -i /path/to/keyfilename.pem locally.
  10. Inside SSH, install "mono-complete" via sudo apt-get install mono-complete.
  11. Make sure that Mono is installed via mono -V.
  12. Update the root SSL certificates via sudo mozroots --import --sync.
  13. Upload Relativity binaries to the server using SFTP, for example via FileZilla or Transmit. Don't forget to add your public key file to the list of keys in the SFTP client. The authentication method should be Normal, the username ubuntu, no password needed. The recommended upload path is /home/ubuntu/relativity.
  14. Add Relativity to the startup scripts on the server via sudo nano /etc/rc.local by adding one line: mono-service2 -d:/home/ubuntu/relativity /home/ubuntu/relativity/Relativity.exe --aws. Write the file to disk by pressing Ctrl+O Enter and then Ctrl+X.
  15. Restart the instance using sudo reboot.
  16. Wait until the instance is accessible again via ssh (which means that it finished booting).
  17. Try to access Relativity using http://ip-address-here:7099/js/.

If access fails, go back to step (15) to check for typos and/or try to start Relativity manually using the mono-service2 command line given above, to check for possible error messages.

Once everything is working, you are ready to create an image:

  1. Shut down the instance.
  2. Wait until it is fully shut down.
  3. In the EC2 console, select Instance ManagementCreate Image.
  4. Wait for process completion
  5. Wait some more...

Done. You can now boot new instances from this image, publish it or share it with other members of your team.

Note: We destroy the key file used to set up the publicly available Relativity Server AMI images, so you can be sure that nobody, including us, can ever access your live instances.