Step-by-step guide
- SSH into your server
Change directory into the UniFi home directory
cd /opt/UniFi
Make a backup of the keystore
cp data/keystore data/keystore.bak
Generate the Certificate Signing Request (CSR)
openssl req -new -newkey rsa:2048 -nodes -out unifi.csr -keyout unifi.key
You can also use the DigiCert Easy CSR tool.
Get your certificate signed by your Certificate Authority of choice. We recommend DigiCert.
Copy and paste your signed certificate to the server in the current UniFi home directory.
nano unifi.crt
- Press Control-X to exit
- Type Y and press Enter to save the file
Create a PKCS#12 archive
openssl pkcs12 -export -in unifi.crt -inkey unifi.key -out unifi.p12 -name unifi -password pass:aircontrolenterprise
If your CA requires an intermediate certificate, append the following to the previous command before submitting it.
-CAfile "intermediate_cert_from_CA.crt" -caname root
Import the PKCS#12 archive into the keystore
keytool -importkeystore -deststorepass aircontrolenterprise -destkeypass aircontrolenterprise -destkeystore data/keystore -srckeystore unifi.p12 -srcstoretype PKCS12 -srcstorepass aircontrolenterprise -alias unifi
You will be asked the following
Existing entry alias unifi exists, overwrite? [no]:
- Type yes and press Enter
- You may get a warning about the JKS keystore using a proprietary format, but you can ignore that.
Restart the UniFi service
systemctl restart unifi
- That's it! The new certificate should now be active!
Related articles