[Support] Linuxserver.io - Unifi-Controller


Recommended Posts

On 1/12/2024 at 8:02 AM, jademonkee said:

Sooooo the Mongo docker now starts/runs fine again...

There was an update to the Mongo container, so maybe it was just a bug? Or maybe some lock on some file expired?

I don't know what's going on anymore lol


DO AT YOUR OWN RISK!

Reviewing: https://www.mongodb.com/docs/manual/reference/program/mongod/#core-options

and https://stackoverflow.com/questions/54695525/how-to-reduce-mongo-log-verbosity-in-a-docker-compose-image

I recommend translating this to unraid via docker compose.

*DO at your OWN RISK!

If you wish to create a logless mongo db. I recommend making a docker compose mongo instance using the docker compose plugin:

found in the community app store
image.png.f35b4a4ee8774a1d4fa4ce26a4bbdeca.png

add a new stack: we will call in mongo
image.thumb.png.03b7ad6d7c9a7f97a323c51380d21802.png

 

click the setting gear edit stack
image.png.c79cc4cbfd43f59fa63ecb915b6d95d1.png

 

Select compose file

image.png.dd17f5f712e5683e3e71cc164a0dff66.png

 

add the compose data.
image.thumb.png.708f6210e15c5b284cec1bd900b22273.png

Tested and working to have a mongdb no logs:
Thank you https://www.composerize.com/

version: "2.4"
services:
    mongo:
        container_name: MongoDB
        network_mode: host
        environment:
            - TZ=America/Chicago
            - HOST_CONTAINERNAME=MongoDB
            - TCP_PORT_27017=27017
        ports:
            - 27017:27017
        labels:
            - net.unraid.docker.managed=dockerman
            - net.unraid.docker.icon='https://raw.githubusercontent.com/jason-bean/docker-templates/master/jasonbean-repo/mongo.sh-600x600.png'
        volumes:
            - /mnt/user/appdata/unifi-controler/mongodb/db-data/:/data/db:rw
            - /mnt/user/appdata/unifi-controler/mongodb/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
        image: mongo:7.0-rc
        command:
            - --quiet
            - --logpath 
            - /dev/null


This is a YAML file syntax spacing is a must!

Remember to make a init-mong.js file first! Change path location to match where your files are saved at. These docker settings such as network host and variable paths in js file are needed before running this compose and database creation...

 

it is recommended to use a supported mongo image per the linux IO team. mongo:4.4-rc
I chose to run the latest stable mongo db. 

LSIO Lattest in support mongo db: https://hub.docker.com/layers/library/mongo/4.4-rc/images/sha256-0c5ab9a1de8e0bb1cef45fbc2f5a2c21fc003fddc15c30085257cb60ac00b76f?context=repo&tab=vulnerabilities
 


to start the docker via compose. click compose up:

image.thumb.png.bdcd1f03adfead8b2284ea6b7cfa4c22.png

 

and you will see the docker in the above. I recommend clicking the switch to auto start the compose at boot.

image.thumb.png.bdc0a6df5295d40b2aa1a4b1fe786877.png

the docker should auto start.
image.thumb.png.87e4c4dca6ec0dfd525380874c09551b.png

now to add the unifi network controller to test as I don't know the consequence of disabling the log for the docker will be.

 

image.png

Edited by bmartino1
Update to tested working instance.
Link to comment

BIG THANKS to WGstarks, PeterAsking and others in the form here for the information and help with transition of the docker for continued access of the UNIFI controller.

Search the forum, they say 😛 ... Hope this can get pinned.
 

See Application Setup:
https://github.com/linuxserver/docker-unifi-network-application


The Reason why the switch docker maintainer moving systems and not support sql upgrades within the docker.
https://info.linuxserver.io/issues/2023-09-06-unifi-controller/

 

 

 

how to transition to the new docker:

 

 

How to make the JavaScript file

 

 

Edited by bmartino1
  • Thanks 1
Link to comment
  • 2 weeks later...

I'm having trouble with the setup and not sure why. I have tried to follow the instructions. The unifi web interface is not reachable.

These are the steps I took:

1. backup the deprecated ls.io unifi container.

2. Install mongodb with the init script

init-mongo.js

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

 

docker run

docker run
  -d
  --name='MongoDB'
  --net='bridge'
  -e TZ="Europe/Budapest"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="TEVENAS"
  -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/mongodb/mongo_init/init-mongo.js':'/docker-entrypoint-initdb.d/init-mongo.js':'rw' 'mongo'

53b1599bcd21ae9bca1461eb19327e5e4a4952ee6df196f2025fe28c26cd325a

 

Then setup the new unifi container:

docker run
  -d
  --name='unifi-network-application'
  --net='bridge'
  -e TZ="Europe/Budapest"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="TEVENAS"
  -e HOST_CONTAINERNAME="unifi-network-application"
  -e 'MONGO_USER'='daninet'
  -e 'MONGO_PASS'='pwd'
  -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://192.168.1.200: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/user/appdata/unifi-network-application':'/config':'rw' 'lscr.io/linuxserver/unifi-network-application'

aaa2d5762f3f99c50def5ef5a419972aba766006c1351c58382cfe57347f8bf5

 

Now the container log is telling me the following:

*** Waiting for MONGO_HOST unifi-db to be reachable. ***
*** Defined MONGO_HOST unifi-db is not reachable, cannot proceed. ***

 

What is exactly unifi-db? I did not define it anywhere but the documentation says use this.

They are both on the same subnet. My other DBs are working on this subnet.

 

 

ksnip_20240125-095432.png

Link to comment
1 hour ago, daninet said:

I'm having trouble with the setup and not sure why. I have tried to follow the instructions. The unifi web interface is not reachable.

These are the steps I took:

1. backup the deprecated ls.io unifi container.

2. Install mongodb with the init script

init-mongo.js

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

 

docker run

docker run
  -d
  --name='MongoDB'
  --net='bridge'
  -e TZ="Europe/Budapest"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="TEVENAS"
  -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/mongodb/mongo_init/init-mongo.js':'/docker-entrypoint-initdb.d/init-mongo.js':'rw' 'mongo'

53b1599bcd21ae9bca1461eb19327e5e4a4952ee6df196f2025fe28c26cd325a

 

Then setup the new unifi container:

docker run
  -d
  --name='unifi-network-application'
  --net='bridge'
  -e TZ="Europe/Budapest"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="TEVENAS"
  -e HOST_CONTAINERNAME="unifi-network-application"
  -e 'MONGO_USER'='daninet'
  -e 'MONGO_PASS'='pwd'
  -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://192.168.1.200: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/user/appdata/unifi-network-application':'/config':'rw' 'lscr.io/linuxserver/unifi-network-application'

aaa2d5762f3f99c50def5ef5a419972aba766006c1351c58382cfe57347f8bf5

 

Now the container log is telling me the following:

*** Waiting for MONGO_HOST unifi-db to be reachable. ***
*** Defined MONGO_HOST unifi-db is not reachable, cannot proceed. ***

 

What is exactly unifi-db? I did not define it anywhere but the documentation says use this.

They are both on the same subnet. My other DBs are working on this subnet.

 

 

ksnip_20240125-095432.png

I just specify the IP address of the Mongo host, rather than a hostname. So delete the Unifi controller image (it only evaluates the name on the first run) and set MONGO_HOST as:

192.168.1.200

Note that I don't use "bridge" but a custom network, but I think you'll be fine specifying your server's IP.

  • Thanks 1
Link to comment

Hello! 

 

I followed the instructions here: https://old.reddit.com/r/unRAID/comments/1abxn3i/upgrading_to_linuxserverio/

 

I cannot access the webui for the new unifi-network-application container (there is no option to enter a webui and going to it manually results nothing) and mongodb doesn't have any data going to it. There is no data in the databases. 

 

Help? 

 

1081307086_Screenshot2024-01-26at7_10_36PM.thumb.jpg.5106049c60c32ece92aa626489c11547.jpg

 

EDIT1: I have a http error code 404 on port 8443/manage

 

Log shows: *** Waiting for MONGO_HOST 192.168.1.183 to be reachable. ***

 

EDIT: I am getting authentication errors in mongodb for user "unifi." I literally copied this exactly from the post I mentioned above: 

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

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

Logs show "could not find user unifi for db unifi"

 

Where do I go from here?

More logging below from mongodb.

 

>{"t":{"$date":"2024-01-26T20:26:40.305-06:00"},"s":"I",  "c":"ACCESS",   "id":20249,   "ctx":"conn4734","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-1","speculative":false,"principalName":"unifi","authenticationDatabase":"unifi","remote":"172.17.0.6:49358","extraInfo":{},"error":"UserNotFound: Could not find user \"unifi\" for db \"unifi\""}}

 

 

FINAL EDIT: I tried some stuff and it worked. 

Edited by urbanracer34
fixed
Link to comment
On 1/25/2024 at 7:54 PM, daninet said:

Now the container log is telling me the following:

*** Waiting for MONGO_HOST unifi-db to be reachable. ***
*** Defined MONGO_HOST unifi-db is not reachable, cannot proceed. ***

 

I'm getting the same error and cannot figure out why either.

 

My Unraid Server is at 192.168.0.25, using bridge for MongoDB and br0 for the UniFi Network Application but I don't believe that should be an issue. I've tried moving MongoDB to the same network (using br0) and it didn't change anything.


MongoDb:

 

docker run
  -d
  --name='MongoDB'
  --net='bridge'
  -e TZ="Australia/Sydney"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Tower"
  -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' 'mongo:4.4'

0f7783e566a2de9b4d39d316d114ed69b88110c2e8abb76078e130bad6178db5

 

I create the user etc. by connecting to the console of that MongoDB container and running the 2 commands:
 

db.getSiblingDB("UniFi").createUser({ user: "UniFi", pwd: "xxxxx", roles: [{ role: "dbOwner", db: "UniFi" }] });
db.getSiblingDB("UniFi_stat").createUser({ user: "UniFi", pwd: "xxxxx", roles: [{ role: "dbOwner", db: "UniFi_stat" }] });


unifi-network-application:

 

 docker run
  -d
  --name='unifi-network-application'
  --net='br0'
  --ip='192.168.0.99'
  -e TZ="Australia/Sydney"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Tower"
  -e HOST_CONTAINERNAME="unifi-network-application"
  -e 'TCP_PORT_8443'='8443'
  -e 'UDP_PORT_3478'='3478'
  -e 'UDP_PORT_10001'='10001'
  -e 'TCP_PORT_8080'='8080'
  -e 'UDP_PORT_1900'='1900'
  -e 'TCP_PORT_8843'='8843'
  -e 'TCP_PORT_8880'='8880'
  -e 'TCP_PORT_6789'='6789'
  -e 'UDP_PORT_5514'='5514'
  -e 'MONGO_USER'='UniFi'
  -e 'MONGO_PASS'='xxxxx'
  -e 'MONGO_HOST'='192.168.0.25'
  -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.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/unifi-network-application-icon.png'
  -v '/mnt/user/appdata/unifi-network-application':'/config':'rw' 'lscr.io/linuxserver/unifi-network-application'

fe2fadf61cd8f3ff452dd6be5484be2a5f54a6a6edf1e516ed925155958431fb


I just get this in the UniFi logs:
 

*** Waiting for MONGO_HOST 192.168.0.25 to be reachable. ***
*** Defined MONGO_HOST 192.168.0.25 is not reachable, cannot proceed. ***


Any help would be much appreciated.

EDIT:
Got it working, I had to go to Settings > Docker and make sure 'Host access to custom networks' was set to Enabled.

image.png

Edited by MattFaz
Resolved
Link to comment

Good Morning Everyone 

 

I'm looking for some help and guidance with getting the new unifi container working with MongoDB.

 

I have followed the instructions to the tee but I'm getting no success at all.

 

I have created my init-mongo.js file and put it in the following path //mnt/user/appdata/mongodb/unifi

 

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

 

Within MongoDB i have changed the repository to install version - mongo:7.0-rc, I have changed the network to Host and i have created the path to the .js file. Then started the container within unraid. 

 

Installed the new version of the unifi controller and matched the details from my .js file to the variables within the unifi container installing wizard. Applied and started the container. Within the few seconds i see the .js file being read in the logs on mongoDB but its just full of errors. Which i have attached a picture of within this thread.

 

i did see someone else within this thread have the same issue as me and he resolved by enabling allow host network to see custom networks. I have enabled this and i still have the same issue.


Any help would be greatly appreciated

Mongo.png

.js file.png

Errors.png

Unifi.png

Edited by Dialatech2303
Link to comment
24 minutes ago, PeteAsking said:

Unsure but you can try the other docker container (the reborn one) and see if thats easier for your use case and setup. 

 

Unfortunately i cant use that one. I have tried. When i try to restore from the backup file. It says the backup file is from a newer version of the controller. 

Link to comment
35 minutes ago, Dialatech2303 said:

 

Unfortunately i cant use that one. I have tried. When i try to restore from the backup file. It says the backup file is from a newer version of the controller. 

Yes when you restore it make sure you have changed the tag to be the same version you are coming from, that is normal.

Link to comment
  • 2 weeks later...
  • 2 weeks later...

This setup was working great for me until about a week ago and now I get a 404 error. No errors showing in the logs. Anyone else getting this error in the last week? Wondering what could have caused it to stop. Hadn’t made any changes to either Unifi or mongo. 

Link to comment
On 2/17/2024 at 9:13 AM, jhabers said:

Im confused on what I should put in for a tag. Should I not use :latest? I see people using 7.0-rc which I can do but does that mean that mongo will stay at the 7.0-rc version and never upgrade when updates come out?

 

Correct. I used 7-rc as that is the latest as of writing. LSIO wants us to stay on 4.4

Updates are still maintained. if you use a set tag... the latest tag for mongos will not work at a docker update release.

 

it is recommended to use a supported mongo image per the linux IO team. mongo:4.4-rc
I chose to run the latest stable mongo db. 

LSIO Lattest in support mongo db: https://hub.docker.com/layers/library/mongo/4.4-rc/images/sha256-0c5ab9a1de8e0bb1cef45fbc2f5a2c21fc003fddc15c30085257cb60ac00b76f?context=repo&tab=vulnerabilities

 

For simplicity and access, I recommend setting the network mode to host.

If you want your mongo db to be on the host bridge, you need other setting found earlier on the forum by wgstarks. as a bridge network requires other setting to allow another docker on the network to communicate to it. ALL DEPENDS ON YOUR SETUP!

 

 

Please see as that is the best documentation I have atm.

 

 

Otherwise, use Pete Asking Version.

Edited by bmartino1
Link to comment

As this is a network tool. I think this may be better off used as a LXC:


(I assume you have already made a backup of your unifi controller via the controller settings...)
To use unifi network as a LXC:
LXC may be a bit more advance than a docker point and click solution. But give you more control and a full linux environment to do other necessary things. Essentially, this is what's running in pete asking version of the docker...

 

If you want more granular control, you can install the unifi application in a debian/ubuntu lxc container.

Please see the support form for lxc: Be sure to visit the support form for LXC. 



So let's take a look at the LXC option first we need to install the plugin: 
image.png.3b5cfc874eb27a523aed697c7a77c45b.png

 

set up your lxc path options. I chose to put them under the appdata where docker data is stored.

 

run to fix an issue with unraid /var and lxc path Thanks LXC support team and ICH777 for their assistance:


 

Go to setting LXC set your options:
image.thumb.png.b55499077374add4de5d368b5f90b38f.png

*My options are set up to use the unraid VM network for an IP address. Your network setting and access to the web server may differ!

You may want to use bond0

 

run script (4th pin) to be able to use lxc on unraid:

*OPTIONAL! - This May or May not be required! Only run if you are unable to make a container form template!

 

LXC_PATH=$(cat /boot/config/plugins/lxc/lxc.conf | grep "lxc.lxcpath=" | cut -d '=' -f2 | head -1)
rm -rf /var/cache/lxc ${LXC_PATH}/cache
mkdir -p ${LXC_PATH}/cache
ln -s ${LXC_PATH}/cache /var/cache/lxc

 

Now go to LXC tab similar to VM and add a container:
image.thumb.png.d817cd755fb1d6cffa7672c5ff89fd42.png

 

In my setup for this LXC container, I chose Ubuntu (jammy template). There is a good tutorial here to follow. It may be recommended to use the bionic template at this time. https://help.ui.com/hc/en-us/articles/220066768-Updating-and-Installing-Self-Hosted-UniFi-Network-Servers-Linux

 

I chose to use jammy and had to go after the deb file individual...


Now let's activate our container and run some commands for setup:
image.png.ab8410e91cbf3c7710c28b066d4f05d2.png

 

First some necessary settings and installs:

 

update packages in container:
 

apt-get update && apt-get upgrade -y

 

Be sure to set up your timezone (fix date and time) by running 

 

dpkg-reconfigure tzdata

 

set a root password:

 

passwd

 

Optional Package that are nifty to have:
 

apt-get install mc nano vim openssh-server nfs-common cifs-utils -y

 

Install some dependency packages:

apt-get install openjdk-17-jre-headless curl libcurl4 ca-certificates apt-transport-https

 

for Ubuntu jammy download the required debs and server to install:

we will be grabing a missing lib for mongdb 4.4, mogodb, and the unfi application:

cd /root/
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
wget https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/4.4/multiverse/binary-amd64/mongodb-org-server_4.4.29_amd64.deb
wget https://dl.ui.com/unifi/8.0.28/unifi_sysvinit_all.deb

 

Download locations sources:

Lib - ubuntu archive form bionic

mongodb: https://www.mongodb.com/try/download/community-kubernetes-operator

unifi applications: https://ui.com/download/releases/network-server

^ watch for 4.4 updates and unifi updates...


now install the deb files.

#root@Unifi:~# ls
#libssl1.1_1.1.1f-1ubuntu2_amd64.deb  mongodb-org-server_4.4.29_amd64.deb  unifi_sysvinit_all.deb
 

cd /root/
dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb 
dpkg -i mongodb-org-server_4.4.29_amd64.deb 
dpkg -i unifi_sysvinit_all.deb

 

Congrats, that's it, unifi will auto make the db in mongo. 

service unifi status

 

Remember the https port is set to 8443

https://192.168.1.4:8443/

At the web UI restore from backup.

 

Type to get ip address of lxc container and unifi web UI should be accessible.

ip a

 

I also recommend following the tutorial from here to install:
https://help.ui.com/hc/en-us/articles/220066768-Updating-and-Installing-Self-Hosted-UniFi-Network-Servers-Linux

 

After the deb files have installed in Jammy we can run the tutorial command to use apt-get update and upgrade to install necessary packages when updates available.

 

Jammy optional add to source list for updates latter:

echo 'deb [ arch=amd64,arm64 ] https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list

sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50

wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
echo "deb [trusted=yes] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update

sudo apt-get update && sudo apt-get install unifi -y

 

 

Now that we can use apt-get update commands to update the packages / server, lets have the lxc auto do that:

sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades

 

I recommend running jammy as it is the current Ubuntu LTS.

 

BUT I would recommend use PeteAsking docker as he is doing a great job at maintaining it.


#Edit:
apt-get update --allow-releaseinfo-change


with the update to the network controller some settings here for jammy install may differed form client to client. There may need to be a source file edit to enable repository access to install some packages for mongo db outside what was listed.

Sadly unattended updates didn't auto update to next release actual repository errors with a change order had to run the command "apt-get update --allow-releaseinfo-change" multiple times and then apt-get upgrade.

the unify upgrade install will require you to make a backup first before preceding to next release. If you don't have a backup and hit no, it will not make one and stop unifi. However (as i do have a backup in event of error. You can hit yes, and the system should be fine but do at your own risk!.

LXC is great and I have not had any issues but would still need checking to the Linux environment over a docker image, its best to use pet asking version and move tags when ready.

Edited by bmartino1
notify of autoupdate and next verion chgnes upgrade.
Link to comment

I got this up and running yesterday after a lot of fiddling, but now when I am looking at my topology page I dont see my unraid server listed, but I see a device called 'unifi' using the same IP address. I initially had an error message saying that two devices were using the same IP address, but after switching the containers to bridge mode I am still only seeing the 'unifi' device. The 'unifi' device had a unique MAC address, but when I try to lookup the vendor it comes back as invalid. It also says no data is being used even though the actual unraid server with the same IP is downloading something. 

 

Has anyone else seen this?

Link to comment
On 3/5/2024 at 6:09 AM, RedMoose said:

I got this up and running yesterday after a lot of fiddling, but now when I am looking at my topology page I dont see my unraid server listed, but I see a device called 'unifi' using the same IP address. I initially had an error message saying that two devices were using the same IP address, but after switching the containers to bridge mode I am still only seeing the 'unifi' device. The 'unifi' device had a unique MAC address, but when I try to lookup the vendor it comes back as invalid. It also says no data is being used even though the actual unraid server with the same IP is downloading something. 

 

Has anyone else seen this?

 

I have, this means you have a unifi switch added to the controller and unfi switch is seeing the vhost/macvlan ip calls and network of same ip/mac address. You can ignore this, as that is how ipvlan is supposed to work. Otherwise, I recommend using macvlan docker setting by fixing some network settings.

 

 

Edited by bmartino1
Link to comment

Anybody experience browser tab freeze after login to the gui?

I just did a complete re-install of mongodb and unifi-network-app only to find out that the issue was the browser.

Brave tab ran out of memory after being frozen for some time, chrome is just working fine.

Link to comment
  • 4 weeks later...
On 3/3/2024 at 5:38 PM, bmartino1 said:

As this is a network tool. I think this may be better off used as a LXC:


(I assume you have already made a backup of your unifi controller via the controller settings...)
To use unifi network as a LXC:
LXC may be a bit more advance than a docker point and click solution. But give you more control and a full linux environment to do other necessary things. Essentially, this is what's running in pete asking version of the docker...

 

If you want more granular control, you can install the unifi application in a debian/ubuntu lxc container.

Please see the support form for lxc: Be sure to visit the support form for LXC. 



So let's take a look at the LXC option first we need to install the plugin: 
image.png.3b5cfc874eb27a523aed697c7a77c45b.png

 

set up your lxc path options. I chose to put them under the appdata where docker data is stored.

 

run to fix an issue with unraid /var and lxc path Thanks LXC support team and ICH777 for their assistance:


 

Go to setting LXC set your options:
image.thumb.png.b55499077374add4de5d368b5f90b38f.png

*My options are set up to use the unraid VM network for an IP address. Your network setting and access to the web server may differ!

You may want to use bond0

 

run script (4th pin) to be able to use lxc on unraid:

*OPTIONAL! - This May or May not be required! Only run if you are unable to make a container form template!

 

LXC_PATH=$(cat /boot/config/plugins/lxc/lxc.conf | grep "lxc.lxcpath=" | cut -d '=' -f2 | head -1)
rm -rf /var/cache/lxc ${LXC_PATH}/cache
mkdir -p ${LXC_PATH}/cache
ln -s ${LXC_PATH}/cache /var/cache/lxc

 

Now go to LXC tab similar to VM and add a container:
image.thumb.png.d817cd755fb1d6cffa7672c5ff89fd42.png

 

In my setup for this LXC container, I chose Ubuntu (jammy template). There is a good tutorial here to follow. It may be recommended to use the bionic template at this time. https://help.ui.com/hc/en-us/articles/220066768-Updating-and-Installing-Self-Hosted-UniFi-Network-Servers-Linux

 

I chose to use jammy and had to go after the deb file individual...


Now let's activate our container and run some commands for setup:
image.png.ab8410e91cbf3c7710c28b066d4f05d2.png

 

First some necessary settings and installs:

 

update packages in container:
 

apt-get update && apt-get upgrade -y

 

Be sure to set up your timezone (fix date and time) by running 

 

dpkg-reconfigure tzdata

 

set a root password:

 

passwd

 

Optional Package that are nifty to have:
 

apt-get install mc nano vim openssh-server nfs-common cifs-utils -y

 

Install some dependency packages:

apt-get install openjdk-17-jre-headless curl libcurl4 ca-certificates apt-transport-https

 

for Ubuntu jammy download the required debs and server to install:

we will be grabing a missing lib for mongdb 4.4, mogodb, and the unfi application:

cd /root/
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
wget https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/4.4/multiverse/binary-amd64/mongodb-org-server_4.4.29_amd64.deb
wget https://dl.ui.com/unifi/8.0.28/unifi_sysvinit_all.deb

 

Download locations sources:

Lib - ubuntu archive form bionic

mongodb: https://www.mongodb.com/try/download/community-kubernetes-operator

unifi applications: https://ui.com/download/releases/network-server

^ watch for 4.4 updates and unifi updates...


now install the deb files.

#root@Unifi:~# ls
#libssl1.1_1.1.1f-1ubuntu2_amd64.deb  mongodb-org-server_4.4.29_amd64.deb  unifi_sysvinit_all.deb
 

cd /root/
dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb 
dpkg -i mongodb-org-server_4.4.29_amd64.deb 
dpkg -i unifi_sysvinit_all.deb

 

Congrats, that's it, unifi will auto make the db in mongo. 

service unifi status

 

Remember the https port is set to 8443

https://192.168.1.4:8443/

At the web UI restore from backup.

 

Type to get ip address of lxc container and unifi web UI should be accessible.

ip a

 

I also recommend following the tutorial from here to install:
https://help.ui.com/hc/en-us/articles/220066768-Updating-and-Installing-Self-Hosted-UniFi-Network-Servers-Linux

 

After the deb files have installed in Jammy we can run the tutorial command to use apt-get update and upgrade to install necessary packages when updates available.

 

Jammy optional add to source list for updates latter:

echo 'deb [ arch=amd64,arm64 ] https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list

sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50

wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
echo "deb [trusted=yes] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update

sudo apt-get update && sudo apt-get install unifi -y

 

 

Now that we can use apt-get update commands to update the packages / server, lets have the lxc auto do that:

sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades

 

I recommend running jammy as it is the current Ubuntu LTS.

 

BUT I would recommend use PeteAsking docker as he is doing a great job at maintaining it.


#Edit:
apt-get update --allow-releaseinfo-change


with the update to the network controller some settings here for jammy install may differed form client to client. There may need to be a source file edit to enable repository access to install some packages for mongo db outside what was listed.

Sadly unattended updates didn't auto update to next release actual repository errors with a change order had to run the command "apt-get update --allow-releaseinfo-change" multiple times and then apt-get upgrade.

the unify upgrade install will require you to make a backup first before preceding to next release. If you don't have a backup and hit no, it will not make one and stop unifi. However (as i do have a backup in event of error. You can hit yes, and the system should be fine but do at your own risk!.

LXC is great and I have not had any issues but would still need checking to the Linux environment over a docker image, its best to use pet asking version and move tags when ready.

This worked great.  Gave my DHCP server the generated MAC for the container and it got the same IP as my old controller (docker).  Imported all the settings and up and running.  Thanks!

Link to comment
2 hours ago, Flyinace2000 said:

This worked great.  Gave my DHCP server the generated MAC for the container and it got the same IP as my old controller (docker).  Imported all the settings and up and running.  Thanks!

 

Glad its working for you. There is a word of caution with doing this. You now have to maintain the full Linux environment. Meaning login in from time to time to run package updates and distro changes when next LTS is out. Including unfi server application to next if needed.

 

I stayed with jammy and setup another one for a friend's environment. To use jammy, you need to install the old apt key system. I had to modify the source list to Ubuntu default.

 

root@Unifi:/etc/apt/sources.list.d# cat /etc/apt/sources.list
# Generated by distrobuilder
deb http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

#deb http://archive.canonical.com/ubuntu/ jammy partner
# deb-src http://archive.canonical.com/ubuntu/ jammy partner
root@Unifi:/etc/apt/sources.list.d# 

 

I then had to install and go through the GNPG keys to authenticate the repositories.

 

I ended up with this to satisfy mongo:

image.thumb.png.1094f432957371195f6efab7f81b5ab6.png

 

the unifi template gives us the 3.6 mongdb repository. mong-org is whats needed.

This was my end script to maintain and use mongo db 4.4

root@Unifi:/etc/apt/sources.list.d# cat mongodb-org-3.6.list 
#older 3.6
#deb [trusted=yes] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/3.6 multiverse

deb [trusted=yes arch=amd64 signed-by=/etc/apt/trusted.gpg] https://repo.mongodb.org/apt/ubuntu/ bionic/mongodb-org/4.4 multiverse 

#Depricated key?
deb [trusted=yes arch=amd64 signed-by=/etc/apt/trusted.gpg] https://repo.mongodb.org/apt/ubuntu/ jammy/mongodb-org/4.4 multiverse

 

then apt-get update and if repository keys issues then google fu and find the fix mainly add to the source to trust it or download the gpug key to access the repository.


Its a per client issues as this will be different for everyone as time passes and updates/configurations change. which is why i didn't say or put something up. as I will try to help but not maintain as the point is to have teh end user maintain it them selfs at this point.

the pros >

Lightweight application can run faster and less resources than the docker.

You are in control and can run other application on top such as nmap and other network tools.

No database fuss.

 

The cons

This is a full desktop Linux distro. Your in charge of any CVE / security issues

UNIFI / Ubuntu Support nonexistent for most of any problem you may occur...

When its time to update your on your own. 9i had to fight to move to the next latest realse for lib files in jammy.) I still recommend bionic as long as its still in release and getting updates. Monitor Ubuntu for EoL

 

image.thumb.png.0f843cc17037bfb02bf2d5ecfd8d248f.png

 

^ for these reason, I would still recommend the all in one docker for "unifi reborn" by pete asking.

I have many of Linux IO teams dockers running on multiple Instance.

I trust the Linux IO team. as such to keep with there updates and work i would also recommend the 2 docker system.

 

in the end it per client choice on how they want to interact with the application. LXC give you more gradual control of the system.

Docker is easier to implement and patch/release when needed.

 

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.