× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

UniFi Controller on ReadyNAS

snooker
Star

UniFi Controller on ReadyNAS

Recently I ran into some trouble  (All snapshots disappeared + no new snapshots possible) when I tried to install the UniFi Controller on my ReadyNAS. After I have overcome two small obstacles it works now fine.

 

I would like to share here the solution that works for me on OS 6.6.1:

 

The UniFi Controller needs Java, so we have to install that first. I have choosen Java 7, because Java 8  - my first obsacle - lead me into trouble:

 

sudo apt-get update
apt-get install oracle-java7-jdk

 

Then we have to add the Ubiquiti repository and the key:

 

echo "deb http://www.ubnt.com/downloads/unifi/debian unifi5 ubiquiti" | tee /etc/apt/sources.list.d/100-ubnt.list
apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50

 

After that, we can install the UniFi controller:

 

apt-get install unifi

 

I copied the systemd service file, to /etc/systemd/system in the case that I have to make some tweaks:

 

cp -p /lib/systemd/system/unifi.service /etc/systemd/system

 

After the install there is the second obstacle, that the software in installed unter /var/lib on the OS partition and the included MongoDB will need 3GB under /var/lib/unifi/db, which is not available.

 

So we have to move the UniFi controller to a place with sufficient space, e.g. /apps:

 

cd /var/lib
mv unifi /apps
ln -s /apps/unifi unifi

 

 And now the Unifi controller should start with:

 

systemctl start unifi.service

 

To access the User Interface of the controller navigate to:

 

https://<IP_of_your_ReadyNAS>:8443

 

If it is not working, it might be worth to look into the logs in /var/log/unifi.

 

 

Possible problems:

  • Unifi needs the ports 3478, 8080, 8443, 8843, 8880, 8881, 8882 and 27117. If other Apps use these ports you have to change the settting of UniFi.
  • It might be necessary to activate logrotate for the UniFi logs.

 

 

Message 1 of 9

Accepted Solutions
snooker
Star

UniFi Controller on ReadyNAS 6.7.4

The guide at the top of this thread is a little bit outdated (Oracle Java is no longer in the repository), so here ist a small update:

 



I would like to share here the solution that works for me on OS 6.7.4 (x86):

The UniFi Controller needs Java, so we have to install that first.

 

First we check if Java is already installed (it is not part of the OS, but it may be installed together with some apps):

java --version

If we get back "-bash: java: command not found", Java is not installed on the ReadyNAS, so we have to install it, if we get back a Version String, we can skip the Java installation:

apt-get update
apt-get install install openjdk-7-jdk

 

Then we have to add the Ubiquiti repository and the key:

echo "deb http://www.ubnt.com/downloads/unifi/debian unifi5 ubiquiti" | tee /etc/apt/sources.list.d/100-ubnt.list
apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50


After that, we can install the UniFi controller:

apt-get update
apt-get install unifi


I copied the systemd service file, to /etc/systemd/system in the case that I have to make some tweaks:

cp -p /lib/systemd/system/unifi.service /etc/systemd/system


After the install there is the problem, that the software is installed unter /var/lib on the OS partition and the included MongoDB will need 3GB under /var/lib/unifi/db, which is not available.

So we have to move the UniFi controller to a place with sufficient space, e.g. /apps:

cd /var/lib
mv unifi /apps
ln -s /apps/unifi unifi

 

As the last step we now can update the logrotate configuration to rotate also the Unifi logs:

bash -c 'cat >> /etc/logrotate.d/unifi << EOF
/var/log/unifi/*.log {
    rotate 5
    daily
    missingok
    notifempty
    compress
    delaycompress
    copytruncate
}
EOF'

 

And now the Unifi controller should start with:

systemctl start unifi.service


To access the User Interface of the controller navigate to:

https://<IP_of_your_ReadyNAS>:8443


If it is not working, it might be worth to look into the logs in /var/log/unifi.


Possible problems:

  • Unifi needs the ports 3478, 8080, 8443, 8843, 8880, 8881, 8882 and 27117. If other Apps use these ports you have to change the settting of UniFi.

View solution in original post

Message 9 of 9

All Replies
enkrypt3d
Tutor

Re: UniFi Controller on ReadyNAS

Any tips on getting this to work on 6.7.4? Unable to find java7 in the apt repos.... Wish someone would make an addon for this! 

Message 2 of 9
snooker
Star

Re: UniFi Controller on ReadyNAS

You may try:

 

apt-get install openjdk-7-jdk

This is the default java in Debian jessy.

 

But do it on your own risk - I have not tried it.

Message 3 of 9
enkrypt3d
Tutor

Re: UniFi Controller on ReadyNAS

Already got it working since java is already installed all I had to do is skip the intall of java... works great! 

 

Here is the latest beta package for Unifi controller 5.6.7:

 

https://www.ubnt.com/downloads/unifi/5.6.7-63ab9a7965/unifi_sysvinit_all.deb

 

So much better than running on my PC! 

Message 4 of 9
snooker
Star

Re: UniFi Controller on ReadyNAS

Good to hear, that the Unifi Controller now runs smoothly at your device.

 

I checked it now on my spare ReadyNAS which is running 6.7.4:

 

  • On my device no Java was installed with 6.7.4 (the command "java" was not found at the command line). Maybe your Java was installed piggybacked with another App?
  • As you reported, Oracle Java was not in the apt repository.
  • But using "apt-get install openjdk-7-jdk" to install the openjdk worked fine. And the Unifi Controlled worked also with the openjdk.

 

Message 5 of 9
enkrypt3d
Tutor

Re: UniFi Controller on ReadyNAS

I may have installed java before as this Pro 4 was upgraded from OS4 to OS6... so it may have some bits left over...... 

Message 6 of 9
StephenB
Guru

Re: UniFi Controller on ReadyNAS


@enkrypt3d wrote:

I may have installed java before as this Pro 4 was upgraded from OS4 to OS6... so it may have some bits left over...... 


The OS6 migration would have wiped everything.

Message 7 of 9
enkrypt3d
Tutor

Re: UniFi Controller on ReadyNAS

ah yea you're right - not sure how java got installed......

 

root@NAS:~# java -version
java version "1.7.0_131"
OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9-2~deb8u1)
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)

 

As long as it works I'm fine with it! It may have been installed by one of my addons..

Message 8 of 9
snooker
Star

UniFi Controller on ReadyNAS 6.7.4

The guide at the top of this thread is a little bit outdated (Oracle Java is no longer in the repository), so here ist a small update:

 



I would like to share here the solution that works for me on OS 6.7.4 (x86):

The UniFi Controller needs Java, so we have to install that first.

 

First we check if Java is already installed (it is not part of the OS, but it may be installed together with some apps):

java --version

If we get back "-bash: java: command not found", Java is not installed on the ReadyNAS, so we have to install it, if we get back a Version String, we can skip the Java installation:

apt-get update
apt-get install install openjdk-7-jdk

 

Then we have to add the Ubiquiti repository and the key:

echo "deb http://www.ubnt.com/downloads/unifi/debian unifi5 ubiquiti" | tee /etc/apt/sources.list.d/100-ubnt.list
apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50


After that, we can install the UniFi controller:

apt-get update
apt-get install unifi


I copied the systemd service file, to /etc/systemd/system in the case that I have to make some tweaks:

cp -p /lib/systemd/system/unifi.service /etc/systemd/system


After the install there is the problem, that the software is installed unter /var/lib on the OS partition and the included MongoDB will need 3GB under /var/lib/unifi/db, which is not available.

So we have to move the UniFi controller to a place with sufficient space, e.g. /apps:

cd /var/lib
mv unifi /apps
ln -s /apps/unifi unifi

 

As the last step we now can update the logrotate configuration to rotate also the Unifi logs:

bash -c 'cat >> /etc/logrotate.d/unifi << EOF
/var/log/unifi/*.log {
    rotate 5
    daily
    missingok
    notifempty
    compress
    delaycompress
    copytruncate
}
EOF'

 

And now the Unifi controller should start with:

systemctl start unifi.service


To access the User Interface of the controller navigate to:

https://<IP_of_your_ReadyNAS>:8443


If it is not working, it might be worth to look into the logs in /var/log/unifi.


Possible problems:

  • Unifi needs the ports 3478, 8080, 8443, 8843, 8880, 8881, 8882 and 27117. If other Apps use these ports you have to change the settting of UniFi.
Message 9 of 9
Top Contributors
Discussion stats
  • 8 replies
  • 13278 views
  • 6 kudos
  • 3 in conversation
Announcements