Reply
New Member
Posts: 4
Registered: ‎02-02-2018

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

image.png

Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello @DrHHH,

 

Give this a try.

echo deb http://nl.archive.ubuntu.com/ubuntu bionic main universe >>/etc/apt/sources.list
apt update
apt install jsvc libcommons-daemon-java -y

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 4
Registered: ‎02-02-2018

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hi again Glenn,

 

After adding "deb http://nl.archive.ubuntu.com/ubuntu bionic main universe" to the /etc/apt/sources.list the script ran without errors!

 

It's odd that it's not installing from standard sources? The image is downloaded from ubuntu today and installed on a vmware instance without errors.

 

Thanks again.

 

 

Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello @DrHHH,

 

Yeah its odd.. but glad its working for you Man Happy

Goodluck on your site!

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Member
Posts: 120
Registered: ‎01-05-2015
Kudos: 93
Solutions: 2

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Thanks for the scripts, they solve a lot of problems for installing Unifi controller to Ubuntu 18.04, among which are:

 

  • MongoDB 3.6 with startup problems because of a deprecated parameter and wrong TCP port.
  • Too new Java engine (10 instead of 8)
  • Missing prerequisites (jsvc, binutils)

However, there is one small piece missing:

 

  • Editing the TaskMax parameter for the systemd startup file

 

The default on my Ubuntu Server 18.04.1 was 512, which is too low. I always got failed exec in the Unifi log files and this in dmesg:

 

[24514.336075] cgroup: fork rejected by pids controller in /system.slice/unifi.service

 

The reason (and cure) for this is explained here:

 

https://community.ubnt.com/t5/UniFi-Wireless/Ubuntu-18-04-Unifi-Controller-works-when-started-w-sudo...

 

When I look at the output of "systemctl status unifi", it becomes clear that there are ~900 tasks:

 

● unifi.service - unifi
   Loaded: loaded (/lib/systemd/system/unifi.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/unifi.service.d
           └─override.conf
   Active: active (running) since Fri 2018-08-03 22:27:36 UTC; 8s ago
  Process: 3095 ExecStop=/usr/lib/unifi/bin/unifi.init stop (code=exited, status=0/SUCCESS
  Process: 3269 ExecStart=/usr/lib/unifi/bin/unifi.init start (code=exited, status=0/SUCCESS
 Main PID: 3349 (jsvc)
    Tasks: 890 (limit: 2048)
   CGroup: /system.slice/unifi.service
           ├─ 498 bin/mongod --dbpath /usr/lib/unifi/data/db --port 27117 --unixSocketPref
           ├─3349 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-oracle/jre -cp /usr/
           ├─3350 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-oracle/jre -cp /usr/
           ├─3351 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-oracle/jre -cp /usr/
           └─3365 /usr/lib/jvm/java-8-oracle/jre/bin/java -Dfile.encoding=UTF-8 -Djava.awt

Aug 03 22:23:42 unifi2 systemd[1]: Starting unifi...
Aug 03 22:23:42 unifi2 unifi.init[3269]:  * Starting Ubiquiti UniFi Controller unifi
Aug 03 22:27:36 unifi2 unifi.init[3269]:    ...done.
Aug 03 22:27:36 unifi2 systemd[1]: Started unifi.

New Member
Posts: 1
Registered: ‎06-01-2016

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

First off, thanks for a great script.  I have successfully installed the controller on Ubuntu 16.04 .  The controller launches great.  I would like to secure it using SSL however, my knowledge is very limited.  I have spent a couple days trying to figure out how to secure the controller using SSL.  Can you help me figure out how to do this?

Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello @khansen188,

 

Thanks for your feedback!

I would recommend checking out this video from willie.

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello,

 

I have added UniFi 5.8.28 Stable to the list! Man Happy

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 2
Registered: ‎08-09-2018

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello,

 

Any idea on how to resolve the problem in the attached image? I am trying to update the UniFi controller to the latest version.

 

Thank you,

 

Capture.PNG
Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello @alexluca,

 

 

Could you show me the output of

la -a /etc/apt/sources.list.d/

On a guess that its just the default run this command, let me know the results.

rm /etc/apt/sources.list.d/100-ubnt-unifi.list

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 2
Registered: ‎08-09-2018

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello @AmazedMender16

 

Your second suggestion helped.

 

Thank you,

Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello @alexluca,

 

Glad its resolved!

Also welcome to the community!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 1
Registered: ‎08-09-2018

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Glenn,

 

You rock! I'v spending hours trying to figure out how to install the unifi controller on fresh install of Ubuntu 18.04! With one simple script, it worked (well... I also had the jsvc error that Dr. HHH had, but I did your suggestion:

echo deb http://nl.archive.ubuntu.com/ubuntu bionic main universe >>/etc/apt/sources.list
apt update
apt install jsvc libcommons-daemon-java -y

 and the script worked after that.

 

Thanks Glenn! You're a lifesaver.

Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello @ccsitadmin,

 

Thanks for your feedback!

Goodluck on with your controller/sites!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello everyone,

 

V1.6 includes a fix for common reported issue when jsvc couldn't be found!

Thank you guys for using my scripts!

Please report errors when you run into them, I will be happy to help!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello everyone,

 

V1.7 Fixes a unneeded dialog if you didn't have any issues regarding to jsvc!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 7
Registered: ‎04-08-2018
Kudos: 3

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello Glenn,

 

thanks a lot for all your work, I surely wouldn't have been able to set up my controller in the cloud without you! Hurray

 

One little thing has me puzzled, though: Can I run your installation script every time an update is available or is it recommended for the first install only and manual upgrades after that?

 

Not sure if I'll mess something up either way. Unfortunately, it didn't give me the option to use apt-get in the future back then, so I can't update that way.

 

Sorry for being a complete *nix noob. Biggrinjester

Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello @l0calh0st,

 

Thans for your kind words Man Happy

 

You should be fine if you run my scripts again, just make sure to always backup the controller.

I may make some future changes to the scripts, that you can safely use it to upgrade Man Happy

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 7
Registered: ‎04-08-2018
Kudos: 3

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

…and it worked like a charm, thankee! Thumbsup

Senior Member
Posts: 10,402
Registered: ‎08-04-2017
Kudos: 1691
Solutions: 508

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello Everyone,

 

10/08/2018

 

I have added a second script that is focussed on only updating the controller.

This script includes a solution for updating from 5.6.x to 5.8.x

 

You can download the script HERE, open the spoiler to see how to execute the script.

Spoiler

1. Copy the link location of the script.

2. SSH into your Ubuntu Server, and login as root.

3. Type the following.

wget https://get.glennr.nl/unifi/update/unifi-update.sh && chmod +x unifi-update.sh

4. After you make the script executable you need to run it by using the following command:

./unifi-update.sh

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Reply