I'm a 38-year-old WiFi enthusiast, I work as a Technical Architect at Wageningen University & Research and I run my own consulting company MetaWiFi and I participate in several startup companies. I love to talk and write about and around Wi-Fi. This blog is intended to be used partly as notes for me and partly to share knowledge to let the wireless community grow.
Upgrade UniFi Server – A guide to SSL automation and renewal
Upgrading your UniFi Server is essential for maintaining performance and security. In this guide, you’ll learn how to upgrade your self-hosted UniFi Network Server from version 8.2.93 to version 8.6.9 and improve the certificate renewal process using Certbot. Whether you’re managing a single site or a multi-tenant system, these steps ensure a smooth upgrade and better security.
Backup Your UniFi Server
Before upgrading, always back up your server, especially if it’s running in a production environment. Without a backup, you risk losing all configurations and statistics, which can be a major setback.
Create a Snapshot or Backup:
If you’re running a virtual machine, take a full snapshot.
Navigate to Settings > System > Backups in UniFi and download the “Last 7 Days” backup to include statistics and settings.
Tip: Enable automatic backups to avoid losing data in the future.
Download the Latest UniFi Server Image
Next, update to the latest UniFi version:
Download the new image using wget:
wget [link-to-latest-image]
Install it with the dpkg -I command:
sudo dpkg -i
The installer will provide warnings on the initial start screen if additional steps are needed.
Upgrade done!
Upgrade the Hosted Platform
After updating your server, make sure the hosting platform (e.g., Ubuntu) is also up to date:
Or a combination command:
sudo apt update && sudo apt upgrade -y
Set Up a Valid SSL Certificate
To secure your UniFi server, use Certbot to streamline SSL certificate management:
# Import the temp PKCS12 file into the UniFi keystore
printf “\nImporting SSL certificate into UniFi keystore…\n”
keytool -importkeystore \
-srckeystore “${P12_TEMP}” -srcstoretype PKCS12 \
-srcstorepass “${PASSWORD}” \
-destkeystore “${KEYSTORE}” \
-deststorepass “${PASSWORD}” \
-destkeypass “${PASSWORD}” \
-alias “${ALIAS}” -trustcacerts
# Clean up temp files
printf “\nRemoving temporary files…\n”
rm -f “${P12_TEMP}”
# Restart the UniFi Controller to pick up the updated keystore
printf “\nRestarting UniFi Controller to apply new Let’s Encrypt SSL certificate…\n”
service “${UNIFI_SERVICE}” start
# That’s all, folks!
printf “\nDone!\n”
exit 0
sudo /usr/local/bin/unifi_ssl_import.sh
Automate the process by creating a cron job: sudo nano -W /etc/cron.daily/unifi_ssl_import Add the following script: /usr/local/bin/unifi_ssl_import.sh
Certbot will now automatically handle SSL renewals.T
Test and Verify Certificate Renewal Test the setup with a dry run:
sudo certbot renew --dry-run
Since Certbot uses the Apache plugin, you don’t need to stop Apache during the renewal dry-run test. Certbot handles the process seamlessly.
If you follow this guide, your UniFi Network server will be upgraded, secured with a valid SSL certificate, and automated for future updates. If you run into any issues, refer to the logs:
I'm a 38-year-old WiFi enthusiast, I work as a Technical Architect at Wageningen University & Research and I run my own consulting company MetaWiFi and I participate in several startup companies. I love to talk and write about and around Wi-Fi. This blog is intended to be used partly as notes for me and partly to share knowledge to let the wireless community grow.