[Support] Linuxserver.io - Unifi-Controller


Recommended Posts

Its not a big deal @wayner I am working on an easy solution. As you are worried let me put your fears to rest and let me tell you where I have gotten up to. We will need to involve the support of a few people on this unraid forum for a final solution but I have a 7 step migration plan that will keep you working and hopefully we can flesh out a template for the "community apps" so that it can get its own official thread.

 

I have already started testing and moved to a different container and it seems to work fine.

 

At any rate here is a work in progress if anyone else would like to test it as an initial test (for a final solution a backup and restore similar to below will be required again and it is very easy so if you can test please do so).

 

A user I engaged with on reddit was in the same predicament and created his own container to resolve the problem. His is also using ubuntu as a base (same as linuxserver.io image) so is pretty much identical.

 

DO NOT UNDER ANY CIRCUMSTANCES SIMPLY EDIT YOUR CURRENT RUNNING UNIFI CONTROLLER AND JUST REPLACE THE IMAGE REPOSITORY.

 

His container is here: https://hub.docker.com/r/11notes/unifi

 

STEPS TO CHANGE AS AN ALPHA TEST (Should not be dangerous to do):

 

Step 1: Login to linuxserver.io running unifi controller

 

Step 2: Take a backup in the interface (System - backups - Download - last 7 days)

 

Step 3: Shutdown linuxserver.io controller (leave it off and available in case you need to go back). Disable autostart.

 

Step 4: Create new container from template (Add container - unifi controller)

 

Step 5: Change 3 values (name change "unifi-controller" to "unifi-controllerNEW" ; repository change "lscr.io/linuxserver/unifi-controller:version-7.5.187" to "11notes/unifi:7.5.187" ; change under more settings ‘appdata path to have ‘NEW’ on the end eg: /mnt/user/appdata/unifi-controllerNEW ; leave all other settings alone. (Note if you fail to change these 3 settings you will wipe your old container.)

 

Step 6: Hit apply (It is created from a template exactly the same as the old settings, only thing left is to restore from backup just created).

 

Step 7: Restore from backup after logging in (eg: https://192.168.2.4:8443) and set docker to autostart on unraid.

You can now login and site is restored.

 

As always, please take a backup before just following some randos instructions on the internet. Im trying my best but not infallible, if you manage to find some way to blow up your house following the above steps, there isnt much I can do so just be logical, check you understand whats going on and so on.

 

Benefits of this method: 1 docker container is maintained going forward, very easy to migrate to, pretty much no customization beyond giving it a new name and pointing it to a new image location since it uses all the same settings as the old template

 

Any feedback on this idea appreciated. Currently settings are not preserved on reboots of the image so this is a test only before you revert to your old container (I think, not sure still testing this).

 

Kind regards

P

Edited by PeteAsking
Fixed error
  • Thanks 2
Link to comment

Its more complex to setup and requires 2 docker containers running and communicating with each other. So generally as complexity increases there is more that can go wrong and lower reliability is expected. Also nobody has started looking at how to migrate to it but you could take a look and tell us if its super easy.

Link to comment
38 minutes ago, PeteAsking said:

you could take a look and tell us if its super easy.

I’m going to take a shot at the migration. I can see from just a cursory look that it won’t be “super easy”. 😁

It’s rather disconcerting that the docker doesn’t have an unRAID support thread. At one time LSIO recommended running all their dockers on unRAID. Your path is probably a better option. Are you including Mongo in the image?

Link to comment
3 minutes ago, wgstarks said:

I’m going to take a shot at the migration. I can see from just a cursory look that it won’t be “super easy”. 😁

It’s rather disconcerting that the docker doesn’t have an unRAID support thread. At one time LSIO recommended running all their dockers on unRAID. Your path is probably a better option. Are you including Mongo in the image?

Its not my image but yes its identical to what the old soon to be depreciated image is in pretty much every way which is why using it is so simple. Its just picking up where linuxserver.io left off. 

Link to comment
3 hours ago, PeteAsking said:

Its more complex to setup and requires 2 docker containers running and communicating with each other. So generally as complexity increases there is more that can go wrong and lower reliability is expected. Also nobody has started looking at how to migrate to it but you could take a look and tell us if its super easy.

Thanks, that makes a ton of sense.  I would be worried that with two separate dockers that you would update the mongodb docker and the version would no longer work with the Unfi Network Appliance version.

Link to comment
9 minutes ago, wayner said:

Thanks, that makes a ton of sense.  I would be worried that with two separate dockers that you would update the mongodb docker and the version would no longer work with the Unfi Network Appliance version.

Yes that is exactly the sort of issue that could occur and why I dont personally want to go in that direction. 

Link to comment
8 hours ago, PeteAsking said:

Any feedback on this idea appreciated.

Are you willing to take ownership of a template and corresponding support thread here in the forums? I don't want to keep using the LSIO thread for a new reposiitory.

 

It would also be a good time to overhaul a first post with info that has become FAQ throughout this thread.

  • Upvote 2
Link to comment

I dont mind, but I like to make sure I have everything in place before making promises.  So you will have to wait a few days while I test and discuss with the developer of the actual image - because if it transpires he is not accommodating to us using the image then I would be in a position where I have made promises to you guys that I cant keep.  So at this point I am more interested in checking what can be done technically and then ensuring after that this would be a workable long term solution. Then I can come back here and tell you what I have found out so you can be involved in deciding what direction is best overall. Seems like it affects a lot of people so probably best to ensure everyone had a say. 
 

Also it is certainly the case that a valid approach is the one that linuxserver.io has suggested - 2 containers which has mongodb split from the unifi container. They didnt give any detail why this is better for them so I only see one side of the story here. It might be that unraid is different to most users of the images since most users are using podman or docker compose while unraid is just simple pure docker. Hopefully @wgstarkscan get a second option up an running so then you guys can decide at least between 2 options. 
 

Either way I will continue working on a solution as well and let you know what happens but Im pretty much confident that since we have until January to decide that there is no rush and one way or another something will be created by then. It just doesn’t seem like something everyone has to panic over so lets see what people come up with and let everyone decide what they like best based on some actual testing. End of the day we all want something that doesnt break and things were working pretty well I thought up till linuxserver.io decided to depreciate the image so just want to get back to that situation where things can be deployed and not have to worry much. 

 

Hope this makes sense. Just want to reiterate Im not promising anything until I feel confident things are up to my standard so I dont let anyone down on anything. 

  • Like 3
  • Thanks 1
Link to comment

I have been speaking to the developer and he told me he has a github page here: https://github.com/11notes/docker-unifi and he will be keeping it up to date going forward so if we have issues we can open an issue there.

 

One thing he told me is that uid and gid should be 1000. Im not 100% clear on this so I have asked @Squidbut he hasnt gotten back to me on this. I also asked if we could make a community app and test it works but will have to wait his reply.

 

So far this isnt seeming to bad but will post any new information I get as it comes.

 

- P

 

Link to comment

Updated this morning to controller version 7.5.187 from 7.3.83.  Fast update and all went well.  No problems noted so far.

 

Also updated to latest firmware on five APs and three switches.  No issues other than a couple of WiFi clients taking a long time to reconnect to an AP which they eventually did after a device restart.

 

Now it looks l need to follow progress on the new controller solution from @PeteAsking

Link to comment
On 10/23/2023 at 12:28 PM, wgstarks said:

I haven’t done any investigating with this issue so I’m wondering, is there some problem with the LSIO Unifi-Network-Application docker already in CA?

 

On 10/23/2023 at 12:39 PM, PeteAsking said:

Its more complex to setup and requires 2 docker containers running and communicating with each other. So generally as complexity increases there is more that can go wrong and lower reliability is expected. Also nobody has started looking at how to migrate to it but you could take a look and tell us if its super easy.

 

This is a summary of the steps I took to migrate to LSIO's unifi-network-application docker now available in CA. The only guarantee here is that this worked for me so USE IT AT YOUR OWN RISK. If you decide to do this and have problems I'll be glad to help solve them but I am far from a docker expert.

 

NOTES

This guide is based on the readme in the Github project page. I would recommend reading that first before proceeding. I use tags for my docker versions for the Unifi dockers rather than running latest. You will see later in the summary that the tag for unifi controller was 7.3.83. This tag isn't available for unifi-network-application so I went ahead and installed the latest version currently available which is 7.5.187. Luckily it worked. I also found that the docker template is missing an entry for the webUI address so I copy/pasted the entry from the unifi controller docker. Before installing the unifi-network-application docker you should stop the unifi controller docker you already have installed. PLEASE DO NOT DELETE IT until you are sure that there aren't any issues with unifi-network-application. There's always a possibility that you may need to switch back.

 

PROCEDURE

  1. Create a backup in the unifi controller application and download it to your local computer. This will be needed after the docker install is complete in order to restore the app.
  2. Quote from the GitHub project page: 
    Quote

    If you are using the official mongodb container, you can create your user using an init-mongo.js file with the following contents:

    db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}, {role: "dbOwner", db: "MONGO_DBNAME_stat"}]});

    Being sure to replace the placeholders with the same values you supplied to the Unifi container, and mount it into your mongodb container.

    In my case I installed the official mongoDB docker available in CA and used this contents in the init-mongo.js file- 

    db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "password", roles: [{role: "dbOwner", db: "unifi"}, {role: "dbOwner", db: "unifi_stat"}]});

    where MONGO_DBNAME=unifi, MONGO_USER=unifi and MONGO_PASS=password. I created a new folder named mongo_init in my appdata share and saved the init-mongo.js file there. You can store this file anywhere you prefer though.

  3. Open a terminal window and create a custom docker network with the following command- 

    docker network create <network name>

    Replace <network name> with the name you would like to use. I used unifi for simplicity. You will need to use this network for MongoDB and unifi-network-application so that they can communicate with each other.

  4. Go to the CA tab and search for MongoDB. You will see the official docker available in the results. 1150319135_Screenshot2023-10-27at1_44_48PM.png.69a3cac0d1117cb953e414abcb7b8865.png

  5. Install it with the following configuration- 

    docker run
      -d
      --name='MongoDB'
      --net='unifi'
      -e TZ="America/New_York"
      -e HOST_OS="Unraid"
      -e HOST_HOSTNAME="Brunnhilde"
      -e HOST_CONTAINERNAME="MongoDB"
      -l net.unraid.docker.managed=dockerman
      -l net.unraid.docker.icon='https://raw.githubusercontent.com/jason-bean/docker-templates/master/jasonbean-repo/mongo.sh-600x600.png'
      -p '27017:27017/tcp'
      -v '/mnt/user/appdata/mongodb/':'/data/db':'rw'
      -v '/mnt/user/appdata/mongo_init/init-mongo.js':'/docker-entrypoint-initdb.d/init-mongo.js':'ro' 'mongo:4.4.25'
    628975ea8111d6f57c24177ed25533fde878d3acaf0af5f2559d173d5f6c4428
    
    The command finished successfully!

    I had to change the network to my custom unifi network and add the path for the init-mongo.js file. You will need to modify these to fit your system. You can see that I used the tag 4.4.25 for this docker. According to the UNA project page: 

    Quote

    Formally only mongodb 3.6 through 4.4 are supported, however, it has been reported that newer versions will work. If you choose to use a newer version be aware that you will not be operating a supported configuration.

  6. Gon to the CA tab and search for LSIO's unifi-network-application docker. 1264307742_Screenshot2023-10-27at2_08_56PM.png.f71445a5db49651c69efd55f757c9ccc.png
  7. Install this docker with the following configuration: 
    docker run
      -d
      --name='unifi-network-application'
      --net='unifi'
      -e TZ="America/New_York"
      -e HOST_OS="Unraid"
      -e HOST_HOSTNAME="Brunnhilde"
      -e HOST_CONTAINERNAME="unifi-network-application"
      -e 'MONGO_USER'='unifi'
      -e 'MONGO_PASS'='password'
      -e 'MONGO_HOST'='unifi-db'
      -e 'MONGO_PORT'='27017'
      -e 'MONGO_DBNAME'='unifi'
      -e 'MEM_LIMIT'='1024'
      -e 'MEM_STARTUP'='1024'
      -e 'MONGO_TLS'=''
      -e 'MONGO_AUTHSOURCE'=''
      -e 'PUID'='99'
      -e 'PGID'='100'
      -e 'UMASK'='022'
      -l net.unraid.docker.managed=dockerman
      -l net.unraid.docker.webui='https://[IP]:[PORT:8443]'
      -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/unifi-network-application-icon.png'
      -p '8443:8443/tcp'
      -p '3478:3478/udp'
      -p '10001:10001/udp'
      -p '8080:8080/tcp'
      -p '1900:1900/udp'
      -p '8843:8843/tcp'
      -p '8880:8880/tcp'
      -p '6789:6789/tcp'
      -p '5514:5514/udp'
      -v '/mnt/cache/appdata/unifi-network-application':'/config':'rw' 'lscr.io/linuxserver/unifi-network-application'
    30a1a947ab3c10273d89c661359d6ad9ab415bcecb9371e2d0c6f339e03ed262
    
    The command finished successfully!

    Again, I had to add the webUI address (https://[IP][PORT:8443]) and change the network to use my custom unifi network. You will also need to enter the values you used for MONGO_PASS and MONGO_USER in the init-mongo.js file earlier. I would also suggest using tagged versions on this docker since running latest has been rather risky in the past with unifi controller.

  8. Navigate to the unify webui on port 8443 and run new setup. You will need to login to the Ubiquiti website as part of this process. Once the new setup is complete you can restore the backup file that you downloaded at the beginning of this process. This may take a few minutes but once it's complete the app should have all the same devices and configurations.

 

 

Hopefully I haven't missed anything. I'm sure there are probably a few typos. If anyone has any suggestions for changes please let me know.

Edited by wgstarks
  • Like 2
  • Thanks 4
Link to comment
52 minutes ago, wgstarks said:

@PeteAsking I posted my results above. Really wasn't too complicated except for the fact that the instructions on Github are rather generic and not unraid specific. I consider migrating to UNA to be a Plan B though. Hopefully you'll get a new Unifi Controller docker setup.

Thank you for doing this and showing how to do it. This is exactly what we need. Multiple options the community can collectively decide on. So long as we dont get super attached to a particular solution and let everyone collectively decide which is a better option then we can go all in one direction or the other when the time is appropriate. 
 

Currently I have everything in place except a way to get a community app published for unraid as Im having trouble getting hold of squid who is the unraid person we have to speak to to get something published. However I imagine he is just busy which is why we havent heard from him. 
 

Either way Im not particularly worried about getting a good solution in place by January. Since we have 2 potential paths forward it seems likely that one will be fruitful by then and everyone can then start a new forum thread and support each other going forward. Unraid is very flexible and it seems capable in doing pretty much whatever you want. 

Link to comment

Thats a very detailed writup.  Can I assume that the restore from 7.3.83 to 7.5.187 for the new container was all good.  And also, if they are not planning on putting old tag's up - what about the people that may have grey area equipment that may/may not be future supported ?  I personally have these and I think the UAP's may be suspect:

USG-3P

US-8-60W

UAP-AC-Lite

UAP-AC-LR

Link to comment
7 minutes ago, vw-kombi said:

Thats a very detailed writup.  Can I assume that the restore from 7.3.83 to 7.5.187 for the new container was all good.  And also, if they are not planning on putting old tag's up - what about the people that may have grey area equipment that may/may not be future supported ?  I personally have these and I think the UAP's may be suspect:

USG-3P

US-8-60W

UAP-AC-Lite

UAP-AC-LR

The restore went fine. I can’t answer to what LSIO might be planning to do with their image or about equipment compatibility. I do have a UAP-AC-LR and it seems to be detected fine. I haven’t tried any reconfiguring though.

 

edit: I would suggest posting your question on the GitHub project page.

Edited by wgstarks
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.