Creating a Relativity Server AMI from Scratch for 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.
- 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).
- Continue via the Next: Configure Instance Details button.
- Accept the defaults until the step (6), unless you know what you need to change.
- On step (6), add a rule allowing access on port 7099 (the default Relativity Server port).
- Complete the Wizard by pressing Launch.
- When prompted, generate a new key pair in the popup window and store the downloaded .pem file safely.*
- Finally, start the instance.
- Wait until it fully initializes and starts.
Connect to the instance using the following command
ssh -i /path/to/keyfilename.pem ubuntu@ip-address-herewhere 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.pemlocally.
Inside SSH, install "mono-complete" via
sudo apt-get install mono-complete.
- Make sure that Mono is installed via
Update the root SSL certificates via
sudo mozroots --import --sync.
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
Add Relativity to the startup scripts on the server via
sudo nano /etc/rc.localby 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.
- Restart the instance using
Wait until the instance is accessible again via
ssh(which means that it finished booting).
- Try to access Relativity using
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:
- Shut down the instance.
- Wait until it is fully shut down.
- In the EC2 console, select Instance Management → Create Image.
- Wait for process completion
- 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.