How to install a SSL Certificate on Unifi Cloud Key

This guide is for those who want to install an SSL certificate on their Unifi Cloud Key.
By default, the Cloud Key will use a self signed certificate, giving a rather annoying warning that the connection is insecure in your browser.