Reply
New Member
Posts: 25
Registered: ‎03-19-2013
Kudos: 34

Unofficial RHEL/CentOS UniFi Controller rpm packages

[ Edited ]

This thread will contain links to unofficial rpm packages for Red Hat Enterprise Linux (RHEL), CentOS and other clones. These are not official Ubiquiti packages, but building and distributing them has been approved by Ubiquiti. You will need EPEL enabled, or at least the required packages cherry picked.
 

yum install http://dl.marmotte.net/rpms/redhat/el7/x86_64/unifi-controller-5.8.24-1.el7/unifi-controller-5.8.24-1.el7.x86_64.rpm
systemctl enable unifi.service
systemctl start unifi.service

Then navigate to https://<hostname>:8443/

 

20180723 : Released 5.8.24, 5.7.23, 5.6.39

20180313 : Released 5.7.20.

20180130 : Released 5.6.30.

20180108 : Released 5.6.29.

20171214 : Released 5.6.26.

20171120 : Released 5.6.22.

20171031 : Released 5.6.20.

20171024 : Released 5.6.19.

20171016 : Released 5.5.24.

20170731 : Released 5.5.20.

20170704 : Released 5.5.19.

20170627 : Released 5.4.18.

20170606 : Released 5.4.16.

20170109 : Released 5.3.8.

20161124 : Released 5.2.9.

 

These packages are not provided in a repository, as you shouldn't want them to automatically update. Feel free to post feedback, suggestions or requests in this thread.

Member
Posts: 126
Registered: ‎09-01-2016
Kudos: 59

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

[ Edited ]

Changelog:

* Sun Nov 19 2017 Richard Shaw <hobbes1069@gmail.com> - 5.5.22-1
- Update to latest upstream release.

 

For RHEL/CentOS/SL etc, you will also need Fedora EPEL repository installed for mongodb, on CentOS it's already available:

 

yum install epel-release

 

Download links:

unifi-5.6.22-1.fc26.x86_64.rpm (should work for all released versions of Fedora)

unifi-5.6.22-1.el7.centos.x86_64.rpm

unifi-5.6.22-1.el6.x86_64.rpm (completely untested)

unifi-5.6.22-1.fc26.src.rpm

 

Because I don't have anywhere to host these except my Dropbox account you'll need to download them first instead of installing directly from the URL.

 

If it's the first install then you need to enable the firewall config:

# firewall-cmd --permanent --add-service=unifi 
# firewall-cmd --reload

Will add it to the current zone and interface.

 

Thanks,

Richard

New Member
Posts: 27
Registered: ‎12-28-2016
Kudos: 12

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

This is great. This saves me a lot of pain. Keep up the great work. 

 

I'm still trying to wrap my head around why the controller is distributed as a .deb.  I've been in Enterprise Linux for over 10 years and I know very few orgs that run either Debian or Ubuntu in production... I actually can't think of single one. It's almost always RH based distros and sometimes SUSE. .deb's in an enterprise environemt just boggles my mind.

Member
Posts: 126
Registered: ‎09-01-2016
Kudos: 59

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Glad it worked for you!

 

Here's the current stable version:

 

https://dl.dropboxusercontent.com/u/34775202/unifi-5.3.8-1.no.src.rpm

 

Thanks,

Richard

New Member
Posts: 6
Registered: ‎01-02-2017
Kudos: 1

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Thanks for doing this.  Hard to believe Ubiquity doesn't have an "official" rpm distribution.

 

Mark

New Member
Posts: 27
Registered: ‎12-28-2016
Kudos: 12

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Was trying to install on a headless CentOS 7 box today and ran into a dependency issue.

 

In your spec file you require mongodb-server and java.  However, the packages for CentOS are mongodb-org-server (actually this is from the mongo repo)  and since I much prefer OpenJDK over Oracle, my java package is java-1.8.0-openjdk (I actually use the headless version, java-1.8.0-openjdk-headless, as no need for sound and such on a server.)

 

I'm going to try to tweak your spec file and repackage the RPM but that will have to wait for another day.  Again, thanks for the great work.

Member
Posts: 126
Registered: ‎09-01-2016
Kudos: 59

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Good catch, I'll get those updated and update the source RPM (same link)

 

Thanks,

Richard

Member
Posts: 126
Registered: ‎09-01-2016
Kudos: 59

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Just caught what you meant about mongodb... I haven't had any issues using mongodb-server from EPEL and would prefer Fedora EPEL over another 3rd party repo. If you want to use their repo I would suggest that you get them to add a "Provides: mongodb-server" to their package so it will keep everything happy.

 

Thanks,

Richard

New Member
Posts: 27
Registered: ‎12-28-2016
Kudos: 12

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Sorry, I didn't mean that to come across as a plea to update your spec file.  My intention was to play with it myself.

 

In regards to the mongo repo, I agree that keeping it simple is best.  The fewer repos the better.  Apparently CentOS does not have a mongo provider which is why I went to the mongo-org repos.  Admittedly I don't use the RH based distros much, I'm more of a SUSE guy. I chose to play with CentOS as historically it has been a lot closer to RHEL than Fedora.  In the past Fedora has been RH's sandbox where they experiment and try out new things.. if it works then it gets into RHEL. I understand that may not be the case any more and FC is more of a grown up distro now.

 

That in mind, I'll create a FC25 VM to play with.  If it works out better I'll dump CentOS.  I think the java dependency will still be an issue though.

 

Thanks,

Lowell

New Member
Posts: 6
Registered: ‎01-02-2017
Kudos: 1

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Does this RPM work with RHEL6/CentOS6?  When I attempt to install, I get warnings about non-existant user/group (uses root instead) but nothing seems to install.

 

Mark

New Member
Posts: 27
Registered: ‎12-28-2016
Kudos: 12

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

[ Edited ]

I haven't tested this RPM on RHEL6 nor CentOS6.  I did test on CentOS7 and FC25 and ran into some problems.  On FC it was java dependencies and on CentOS is was both java and mongo.

 

I found the following to be much easier:

  1. Install prereq's from repo: mongodb-server, java (I used openjdk headless), binutils, and jsvc
  2. Enable MongoDB to start on boot, for most distros it is something like: 'systemctl enable mongod.service'
  3. Start MongoDB, for most distros something like: 'systemctl start mongod.service'
  4. Open up port 8443 on your server. For CentOS 6 I beleive that is an iptables update - make sure you disable SElinux first. (let me know if you need step by setp and I'll provide)
  5. Download the UniFi.unix.zip
  6. Unpack the UniFi zip file into a directory of your choice
  7. Change directory into you UniFi install
  8. Start your controller, 'java --jar lib/ace.jar start &'
  9. Go to any browser on the same subnet and hit "https://<your server IP>:8443'. You may have to create an SSL exception in your browser for this server.

As a note, I found out the hard way (and after much frustration) that you must have a file system of at least 5GB. Mongo seems to require a minimum of 4GB for its table space. It refuses to start otherwise and I really wasn't able to discern why until after a lot of searching. Not really important if installing on a phycial machine but very important if using a VM.

 

I wasted hours with RPMs on FC25 and CentOS7 and the DEB on Debian Jesse.  Using CentOS 7 and OpenSUSE LEAP with the zip file was MUCH easier and MUCH less frustrating.  I have to say that for an "Enterprise Solution" I'm shocked how poorly the UniFi controller for Linux is documented. The user guide references a blog entry that is not only buried (hard to find) but extremely outdated.

 

Hope that helps.  Let me know if you need me to dive into any details on any of this.

 

Lowell

 

New Member
Posts: 6
Registered: ‎01-02-2017
Kudos: 1

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

[ Edited ]

Thanks for the detailed observations/instructions.  I'll give them a try.

 

For the record, here's what I got:

 

[root@pilot 5.3.8]# rpm -i unifi-5.3.8-1.no.src.rpm
warning: user build does not exist - using root
warning: group build does not exist - using root
warning: user build does not exist - using root
warning: group build does not exist - using root
warning: user build does not exist - using root
warning: group build does not exist - using root
warning: user build does not exist - using root
warning: group build does not exist - using root
[root@pilot 5.3.8]# rpm -qa |grep -i uni
kurdit-unikurd-web-fonts-20020502-6.el6.noarch
cjkuni-uming-fonts-0.2.20080216.1-36.el6.noarch
cjkuni-fonts-common-0.2.20080216.1-36.el6.noarch
unique-1.1.4-2.el6.x86_64
tibetan-machine-uni-fonts-1.901-5.el6.noarch

 

and nothing in /etc/init.d either

 

Mark

Member
Posts: 126
Registered: ‎09-01-2016
Kudos: 59

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages


@mjstraw wrote:

Does this RPM work with RHEL6/CentOS6?  When I attempt to install, I get warnings about non-existant user/group (uses root instead) but nothing seems to install. 


Mark,

 

This is a source RPM not a binary RPM because the software is not redistributable. You need to follow the directions near the top of the thread to install.

 

As far as EL6 I don't have a good way to test so I'm not 100% sure it works but after you rebuild and install the binary RPM if you have any issues let me know. This does require that you have the Fedora EPEL repositories installed.

 

Thanks,

Richard

Member
Posts: 126
Registered: ‎09-01-2016
Kudos: 59

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

You don't need #2, unifi starts it's own instance of mongodb and doesn't use the system service.

I don't have a way to open ports from an RPM so yes you need to know which one and how to do that as a system admin.

I need to double check but I know on my install I have mongo setup to use less space (command line option I need to lookup) but I'm not sure I made that the default.

I don't see how your method is easier, the only thing you need to do apart from installing the resultant binary RPM is open up the correct port, and since it comes with a systemd unit file, it's easy to make sure it starts on boot.

Thanks,
Richard
New Member
Posts: 6
Registered: ‎01-02-2017
Kudos: 1

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

Is the .deb distribution source-only, too?

Mark
New Member
Posts: 27
Registered: ‎12-28-2016
Kudos: 12

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages


@hobbes1069 wrote:
You don't need #2, unifi starts it's own instance of mongodb and doesn't use the system service.

Hmmm.. It failed on me if I didn't enable. Obviously if you enable and reboot you don't have to start.  I'll have to play with it more, maybe it was just a misconfiguration and you don't have to enable/start at all.

 


@hobbes1069 wrote:
I don't see how your method is easier, the only thing you need to do apart from installing the resultant binary RPM is open up the correct port, and since it comes with a systemd unit file, it's easy to make sure it starts on boot.

I would say when running with the distro/version you've tested and with the repos you've enabled, the RPM is probably easier. However, I could never get your RPM to work for me (after several hours of tinkering) but the ZIP worked in about 20 minutes... so for me the ZIP was easier. I'd say a good statement would be "your mileage may vary." I could never get the "official" .deb to work as advertised, either. My personal opinion is the problem is the documentation is unbelievably poor.

New Member
Posts: 27
Registered: ‎12-28-2016
Kudos: 12

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages


@mjstraw wrote:
Is the .deb distribution source-only, too?

Mark

Nope.  It has everything. If you install via APT it should work like a champ.  The problem is I am testing the unstable version which I couldn't seem to find in the deb repo.  If you install the stable version you should be good to go - it will even install your dependencies.

Member
Posts: 126
Registered: ‎09-01-2016
Kudos: 59

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages


@LinuxLowell wrote:

@hobbes1069 wrote:
You don't need #2, unifi starts it's own instance of mongodb and doesn't use the system service.

Hmmm.. It failed on me if I didn't enable. Obviously if you enable and reboot you don't have to start.  I'll have to play with it more, maybe it was just a misconfiguration and you don't have to enable/start at all.


Not sure what's going on there, here's the output from systemctl:

 

# systemctl status unifi
● unifi.service - Ubiquiti UniFi server
   Loaded: loaded (/etc/systemd/system/unifi.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2016-12-31 14:28:28 CST; 1 weeks 0 days ago
  Process: 14149 ExecStop=/usr/bin/java -jar /usr/share/unifi/lib/ace.jar stop (code=exited, status=0/SUCCESS)
 Main PID: 14196 (java)
   CGroup: /system.slice/unifi.service
           ├─14196 /usr/bin/java -jar /usr/share/unifi/lib/ace.jar start
           └─21283 bin/mongod --dbpath /usr/share/unifi/data/db --port 27117 --logappend --logpath logs/mongod.log --nohttpinterface --smallfiles -...

As you can see it starts it's own instance of mongodb. Checking the service files from the mongodb-server package (not sure what the difference between the two is) they are both not running:

 

# systemctl status mongod
● mongod.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
# systemctl status mongos
● mongos.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/usr/lib/systemd/system/mongos.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
New Member
Posts: 25
Registered: ‎03-19-2013
Kudos: 34

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

I have now also updated my package to 5.3.8. I have tested updating with yum and it worked fine :

[2017-01-09 12:04:03,945] <db-server> INFO  db     - DbServer stopped
[2017-01-09 12:04:05,356] <launcher> INFO  system - ======================================================================
[2017-01-09 12:04:05,357] <launcher> INFO  system - UniFi 5.3.8 (build atag_5.3.8_8920 - release) is started
[2017-01-09 12:04:05,357] <launcher> INFO  system - ======================================================================
[2017-01-09 12:04:05,360] <launcher> INFO  system - BASE dir:/opt/UniFi
[2017-01-09 12:04:05,364] <launcher> INFO  system - Current System IP: 192.168.0.1
[2017-01-09 12:04:05,366] <launcher> INFO  system - Hostname: unifi.example.com
[2017-01-09 12:04:05,439] <launcher> INFO  db     - DB version (5.2.9) different from Runtime Version(5.3.8), migrating...
[2017-01-09 12:04:05,441] <launcher> INFO  db     - waiting for db connection...
[2017-01-09 12:04:05,941] <launcher> INFO  db     - Connecting to mongodb://localhost:27117
[2017-01-09 12:04:07,068] <launcher> INFO  system - [server backup] started
[2017-01-09 12:04:07,075] <launcher> INFO  db     - Connecting to mongodb://localhost:27117
[2017-01-09 12:04:07,787] <launcher> INFO  db     - Connecting to mongodb://localhost:27117
[2017-01-09 12:04:07,898] <launcher> INFO  system - [server backup] end
[2017-01-09 12:04:07,964] <launcher> INFO  db     - DB migration to version (5.3.8) is complete.
[2017-01-09 12:04:08,508] <launcher> INFO  db     - Connecting to mongodb://localhost:27117
[2017-01-09 12:04:08,701] <launcher> INFO  webrtc - WebRTC library version: EvoStream Media Server (www.evostream.com) version 1.6.5 build 1971-0b23421-master - Gladiator - (built for Debian-7.0.5-x86_64 on 2016-08-19T15:20:42.000) OpenSSL version: 1.0.2h usrsctp version: 055966bbf6a90836 compiled on machine: Linux debian-7-0-5-64 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64 GNU/Linux
Emerging Member
Posts: 44
Registered: ‎10-14-2016
Kudos: 3

Re: Unofficial RHEL/CentOS UniFi Controller rpm packages

[ Edited ]

I tried installing on my Fedora box but it won't run. I'm running Fedora 24

 

I installed using

dnf install http://dl.marmotte.net/rpms/redhat/el7/x86_64/unifi-controller-5.3.8-1.el7/unifi-controller-5.3.8-1.el7.x86_64.rpm

and didn't have any errors during install. It installed all the dependancies correctly:

Running transaction
  Installing  : mozjs38-38.8.0-2.fc24.x86_64                                                    1/7 
  Installing  : libunwind-1.1-11.fc24.x86_64                                                    2/7 
  Installing  : gperftools-libs-2.5-2.fc24.x86_64                                               3/7 
  Installing  : yaml-cpp-0.5.1-13.fc24.x86_64                                                   4/7 
  Installing  : libstemmer-0-4.585svn.fc24.x86_64                                               5/7 
  Installing  : mongodb-server-3.2.8-2.fc24.x86_64                                              6/7 
  Installing  : unifi-controller-5.3.8-1.el7.x86_64                                             7/7 
  Verifying   : unifi-controller-5.3.8-1.el7.x86_64                                             1/7 
  Verifying   : mongodb-server-3.2.8-2.fc24.x86_64                                              2/7 
  Verifying   : gperftools-libs-2.5-2.fc24.x86_64                                               3/7 
  Verifying   : libstemmer-0-4.585svn.fc24.x86_64                                               4/7 
  Verifying   : yaml-cpp-0.5.1-13.fc24.x86_64                                                   5/7 
  Verifying   : libunwind-1.1-11.fc24.x86_64                                                    6/7 
  Verifying   : mozjs38-38.8.0-2.fc24.x86_64                                                    7/7 

Installed:
  gperftools-libs.x86_64 2.5-2.fc24               libstemmer.x86_64 0-4.585svn.fc24                
  libunwind.x86_64 1.1-11.fc24                    mongodb-server.x86_64 3.2.8-2.fc24               
  mozjs38.x86_64 38.8.0-2.fc24                    unifi-controller.x86_64 5.3.8-1.el7              
  yaml-cpp.x86_64 0.5.1-13.fc24                  

Complete!

But when I try and run the service, it fails each time and I'm not sure why. If anyone has any insight that would be great. Here's the readout from status:

 

● unifi.service - Ubiquiti UniFi Controller
   Loaded: loaded (/usr/lib/systemd/system/unifi.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2017-01-11 14:52:49 PST; 4s ago
  Process: 24282 ExecStop=/usr/bin/java -jar /opt/UniFi/lib/ace.jar stop (code=exited, status=127)
  Process: 24280 ExecStart=/usr/bin/java -Xmx1024M -jar /opt/UniFi/lib/ace.jar start (code=exited, s
 Main PID: 24280 (code=exited, status=127)

Jan 11 14:52:49 isteckplex systemd[1]: Started Ubiquiti UniFi Controller.
Jan 11 14:52:49 isteckplex systemd[1]: unifi.service: Main process exited, code=exited, status=127/n
Jan 11 14:52:49 isteckplex systemd[1]: unifi.service: Control process exited, code=exited status=127
Jan 11 14:52:49 isteckplex systemd[1]: unifi.service: Unit entered failed state.
Jan 11 14:52:49 isteckplex systemd[1]: unifi.service: Failed with result 'exit-code'.

 

 

EDIT: so upon further inspection and testing, the ExecStart command works when manually running it. I can start the controller with java from the command line, but for some reason it fails every time when trying to run as the system service.

Home network: Latest controller running on Ubuntu 18.0.4 via Docker (Stable Candidate Tag), USG, USW-24, USW-8-60, USW-8, 2x UAP-AC-Pro, 2x UAP-AC-M - Future plans for 11 Unifi cameras

Work network: Stable 5.8.x running on Digital Ocean, USG, USW-24, 5x UAP-AC-Lite, NVR, 2x G3 Cameras, 1x G3 Pro Camera, 4x G3 Dome Cameras
Reply