If you followed my guide on installing the UniFi Controller on your Synology in Docker containers, you will notice one of the steps mapped the external ports to the internal docker ports. This provides the Unifi hardware the ports they use to communicate with the controller. However, during upgrade, although you could simply replace the container with the new one, what if it doesn’t work? That’s where this update process comes into play! This guide shows you how to upgrade a container, whilst ensuring the new container ‘takes’ the ports of the old container (yes it was frustrating first time, when I forgot about the ports!).
Instructions
- Log into your Synology and before you start please ensure you do a backup. Then open the Docker application, and head to the registry on the left hand side. (1)
- Then search for the same Unifi container you were using; “jacobalberty/unifi“ in my case. Select the image and click the “Download” button. (2)
- For interest check out the GIT repository for the docker container (specifically the releases)
- This container will then download the latest version and appear in your “Image” tab, as a list of possible containers you can re-deploy/upgrade.
- Click on Containers on the left (1) side of the application. You will then need to power off the container using the toggle at the right hand side of the Unifi Controller row (2).
- When the container is powered down, select the container and click Edit.
- From the Edit screen, you will want to change the name to append some text (eg; -OLD). I would also advise unchecking the “Enable auto-restart” option, so this container doesn’t restart after a system reboot.
- From the “Port Settings” tab, increase all the port numbers by 1 so they don’t clash/aren’t in use in a later step (eg; 8080 becomes 8081)
- At this point you can either go ahead and rebuild the container completely from scratch (make sure you use the same directory as the old one so the container picks up your settings) or you can use the duplicate method to rebuild (which I find quicker!).
- Click on the container you’ve just renamed with -old and click Settings and then Duplicate Settings
- A pop-up will appear and it’s wise to revert the name on the container back to the original (eg; removing -old-copy)
- Once it has duplicated, we will need to update the settings, by selecting the newly copied container and clicking “Edit“
- From the pop-up window re-select “Enable auto-restart“.
- Then move to the port settings tab and fill in the ports with the same values as we had previously.
- This was the step that caused me chaos when I first upgraded as I had duplicate ports on the Old and New containers – so ensure you follow step 7, to enable the ports to be free for this step)
- You can now save these settings, and turn on your newly updated docker container!
- Your settings should persist from the previous container as you’ll be pointing at the same folder as you previously used, but due to docker having a separate runtime to persistent storage, you’ll have new application code.
- It’s worth noting on first boot it may take some time, as the application may be doing database changes, so be patient!
- My second tip is don’t be worried if it looks like you’ve lost all your devices from the UniFi Dashboard. It may be that they haven’t ‘called home’ yet, but you can encourage this by going into the “UniFi devices” tab and clicking on each device to pull their latest settings.