Install Unify controller on NethServer 7

Hi,

The Ubiquity hardware is a well fined hardware for enterprise ( and for home ) and spread the world successfully.
Perhaps, it could be a good implementation for the NethServer project to integratr easely the Ubiquity Software.

For exemple, the Pfsense project integrate perfectly the Ubiquiti Wifi solution.

Edit: To answer the initial topic ask… NethServer do the job perfectly.

I did integrate ubiquity on nethserver 6 in the past. If and when I will need to do it again on 7 I will publish my notes.

which software did you integrate ?

UniFi Controller version 4.

1 Like

absolutely unofficial because the offical linux distro is debian/ubuntu but it exists centos7 rpm

https://community.ubnt.com/t5/UniFi-Wireless/Unofficial-RHEL-CentOS-UniFi-Controller-rpm-packages/td-p/1744595

else the other solution is a manual installation

https://community.ubnt.com/t5/UniFi-Wireless/Installing-UniFi-on-CentOS7-as-a-service/td-p/1524666

and this related howto at home

3 Likes

I am trying a crazy little thing…
from RPMFusion configuration page

yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
for add the source, therefore
yum install unifi.
This is going to install 5.9.29, released in October '18
I can hear VMWare scream…

Ok… Seems that got stuck in firewall section.
after
systemctl enable unifi and systemctl start unifi
calling
systemctl status unifi
i got a nice
● unifi.service - Ubiquiti UniFi server
Loaded: loaded (/usr/lib/systemd/system/unifi.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2019-02-22 02:55:50 CET; 30min ago
Main PID: 7329 (java)
CGroup: /system.slice/unifi.service
├─7329 /usr/bin/java -jar /usr/share/unifi/lib/ace.jar start
└─8956 bin/mongod --dbpath /usr/share/unifi/data/db --port 27117 -...
Feb 22 02:55:50 ns76-01.test.local systemd[1]: Started Ubiquiti UniFi server.
and i tried to make the thing work with these ones
config set unifi service status enabled
config setprop unifi status enabled TCPPorts 8433 access green
mkdir -p /etc/e-smith/db/configuration/defaults/unifi
echo "service" > /etc/e-smith/db/configuration/defaults/unifi/type
echo "enabled" > /etc/e-smith/db/configuration/defaults/unifi/status
signal-event runlevel-adjust
signal-event firewall-adjust
(from http://docs.nethserver.org/projects/nethserver-devel/en/latest/services.html#add-a-new-service)

Seems i need to read a more documentation… unifi is present into network services, from links i can access to port 8443. But i am not able to connect via green.
(also should be nice to add a description, like “NethServer web interface” for httpd-admin)

Just check the thread they linked before, I recall having posted some automation with Ansible and a Button for the “Application” tab of the httpd-admin. Here to be more precise.

1 Like

A big THANKYOU for point me out correctly, @syntaxerrormmm
This is the updated version…
config set unifi service status enabled
config setprop unifi status enabled TCPPorts 8080,8443,8880,8843 UDPPorts 3748,10001 access green
mkdir -p /etc/e-smith/db/configuration/defaults/unifi
echo "service" > /etc/e-smith/db/configuration/defaults/unifi/type
echo "enabled" > /etc/e-smith/db/configuration/defaults/unifi/status
signal-event runlevel-adjust
signal-event firewall-adjust

The howto you has more than 2 years, but the ports are the same.

This part
config set unifi service status enabled
config setprop unifi status enabled TCPPorts 8080,8443,8880,8843 UDPPorts 3748,10001 access green
helped me to have a “network service” only for UniFi. The procedure used by the howto helps to have separated services for mongodb, but the (wonderful) script of Steve Jenkins has only a little issue: has to be changed every time the server changes it’s hostname/fdqn. I’m wondering there could be a way to get from props of the database the hostname…

Full list of commands:
yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
yum install unifi
systemctl enable unifi
systemctl start unifi
config set unifi service status enabled
config setprop unifi status enabled TCPPorts 8080,8443,8880,8843 UDPPorts 3748,10001 access green
mkdir -p /etc/e-smith/db/configuration/defaults/unifi
echo "service" > /etc/e-smith/db/configuration/defaults/unifi/type
echo "enabled" > /etc/e-smith/db/configuration/defaults/unifi/status
signal-event runlevel-adjust
signal-event firewall-adjust

Feel free to test and verify if there’s something wrong in what i did. Also, this use the 5.9.29 (october '18), which is not the latest 5.10.17 i used during last week for setup 4 access points.

4 Likes

Thank you for this manual.

The only thing I missed was:
mkdir /etc/e-smith/db/configuration/defaults/unifi

:slight_smile:

Care to put it on the wiki?

1 Like
UNIFI_HOSTNAME=`config get SystemName`.`config get DomainName`

Great… Therefore there could be a way to allow the import of tls certificate from let’sencrypt…

The “missing” part of this script is that rely on RPM of an old version of Unifi controller, not latest 5.10.19 released from Ubiquiti. I don’t know if alien could translate .deb package to .RPM.

What about downloading the newest ZIP and create the service files manually as described in the howto?

wget http://dl.ubnt.com/unifi/5.10.19/UniFi.unix.zip
unzip UniFi.unix.zip
mv ./UniFi /opt
...

Well, i would like a repository who could dynamically update releases. RPM ease the manual install of mongoDB and some other things.
Anyway, i could give a shot to that starting from scratch with another setup.

It’s not GPL but they allow repackaging, see this thread so if it works with the newest version we could think about a nethserver-unifi.rpm.

Answer seems no, due to glibc version requested (3.4.20)


And MongoDB license change could be the a passport for not include MongoDB into RHEL/CentoOS 8.

Time for a container? Ubiquiti rely a lot on Ubuntu, therefore a little Ubuntu Server container bridged on Green/Blue with UniFi controller install could be viable. The cons for this solution is increase use of memory and disk compared to an app installed on CentOS/NethServer.
Anyway there are plenty of implementations on Docker…
https://hub.docker.com/search?q=unifi&type=image
Linuxserver.io is providing LTS and latest version (still 5.9) in docker.