Unifi controller on fly.io? (abandoned attempt)

I’d like to share my unsuccessful attempt to get the Unifi network controller running on fly.io. I tried using the ghcr.io/linuxserver/unifi-controller Docker container, plus an nginx instance to forward fly.io-terminated SSL to the default self-signed SSL (rather than trying to run letsencrypt in the container). I wasn’t sure if there was an existing fly.io handler that would agree to connect to unchecked HTTPS on the backend.

The nginx proxy seems to work, but I gave up trying to get Unifi’s builtin STUN server to bind to fly.io’s global-services address. There are also probably additional ports that it would prefer to have exposed.

One technique I used was to temporarily replace my app with ghcr.io/linuxserver/openssh-server, in order to copy a backup of my local controller to the volume; then, back to the normal image without the ssh server.

1 Like

This is super interesting! I’m disappointed it didn’t work.

What was the problem binding to the global services IP? You might be able to just bind to 0.0.0.0 to get the same effect.

Here’s Unifi’s documentation. https://help.ui.com/hc/en-us/articles/218506997-UniFi-Ports-Used

The main problem is that the server’s command line is not very well documented.

It does mostly work without STUN but there is an annoying message when it’s not available. Needed for the debug console feature.

It might also be possible to run a more cooperative lightweight STUN server alongside the main controller.