Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

UniFi-Video Installation Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9

[ Edited ]

Hello guys!

 

I wrote these UniFi-Video installation scripts since people have been asking me about it. These scripts were tested on Ubuntu 16.04/18.04/18.10/19.04 and Debian 8/9. If you find any issues while using my scripts please let me know!

 

Those are my personal script and these are not supported by Ubiquiti Networks.

 

 

Regards,

Glenn R.

 

 

Instructions:

 

1) Copy the link location of the script.

2) SSH into your Ubuntu/Debian machine, and login as root. ( Ubuntu | sudo -i  |  Debian | su )

2a) Make sure the ca-certificates package is installed.

apt-get install ca-certificates -y

3) Download the script by executing the following command. ( change it to your wanted version )

wget https://get.glennr.nl/unifi-video/3.10.2/U1604/video-3.10.2.sh

4) Make the script executable ( change it to the script version you downloaded )

chmod +x video-3.10.2.sh

5) After you downloaded the script and made it executable you need to run it, by executing the following command.

./video-3.10.2.sh

6) Once the installation is completed browse to your controller.

https://ip.of.your.server:7443

7) Kudo my post Man Happy

 

 

3.9.x

 

Installation script for UniFi-Video 3.9.12 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi-Video 3.9.12 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi-Video 3.9.12 - Ubuntu 18.10

Installation script for UniFi-Video 3.9.12 - Ubuntu 19.04

Installation script for UniFi-Video 3.9.12 - Debian 8

Installation script for UniFi-Video 3.9.12 - Debian 9 ( MX 18 )

Installation script for UniFi-Video 3.9.12 - Debian 10

 

3.10.x

 

Installation script for UniFi-Video 3.10.2 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi-Video 3.10.2 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi-Video 3.10.2 - Ubuntu 18.10

Installation script for UniFi-Video 3.10.2 - Ubuntu 19.04

Installation script for UniFi-Video 3.10.2 - Debian 8

Installation script for UniFi-Video 3.10.2 - Debian 9 ( MX 18 )

Installation script for UniFi-Video 3.10.2 - Debian 10

 

 

Old Installation Scripts

 

You can download older script versions from HERE.

 

Version History

 

Spoiler
[ 2/10/2018 - v1.0 ]
+ Posted the installation scripts

[ 10/10/2018 - v2.0 ]
+ Check if MongoDB 3.4.x or higher is installed
+ Check if UniFi is already installed
+ Check if dpkg is busy
+ Check if you have the correct script for your Ubuntu Release

[ 13/10/2018 - v2.1 ]
* Added Debian Installation scripts

[ 15/10/2018 - v2.1.1 ]
* Now only displays 1 IP if the server has multiple.

[ 16/10/2018 - v2.2 ]
* Improved MongoDB check.

[ 16/10/2018 - v2.3 ]
* Added a fallback for java.

[ 17/10/2018 - v2.3.1 ]
* Fix JAVA HOME for 32 bit systems

[ 17/10/2018 - v2.4 ]
* Script now doesn't touch the original sources.list.
* Improved package check..

[ 18/10/2018 - v2.4.1 ]
* Improved a check.

[ 18/10/2018 - v2.4.2 ]
* Removed unnecessary lines.

[ 19/10/2018 - v2.4.3 ]
* Fixed a missing line in the script.

[ 20/10/2018 - v2.4.4 ]
* Improved a check.

[ 22/10/2018 - v2.4.5 ]
* Changed to the MongoDB check.

[ 30/10/2018 - v2.5 ]
+ Memory Check.
+ Free disk space check.
+ Create a swap file if system memory is lower than 2 GB.
* Fixed UBUNTU_RELEASE

[ 30/10/2018 - v2.5.1 ]
* Minor changes to the script.

[ 10/11/2018 - v2.5.2 ]
* Changed the MongoDB check.
+ Scripts for Ubuntu 18.10 ( Cosmic )

[ 16/11/2018 - v2.5.3 ]
+ Fallback if keyserver fails ( MongoDB )

[ 19/11/2018 - v2.5.4 ]
* Changed OpenJDK install.
* Improved MongoDB check.

[ 14/12/2018 - v2.5.5 ]
+ Script will now cancel the installation if the free disk space is less than 5GB.
* Minor changes to the script.

[ 21/12/2018 - v2.5.6 ]
* Minor changes to OS detection.

[ 21/12/2018 - v2.6 ]
+ Added support for Mint 18/19.

[ 22/12/2018 - v2.6.1 ]
* Minor changes to the script.

[ 27/12/2018 - v2.6.2 ]
+ Added support for Linux MX 18.

[ 03/01/2019 - v2.7 ]
+ Added service enabled check.
* Improved 64 bit detection.
* Miscellaneous changed to text output.

[ 16/01/2019 - v2.7.1 ]
+ Added check for apt-transport-https.
+ Added check for net-tools.
+ Added check for lsb-release.

[ 20/01/2019 - v2.7.2 ]
* Miscellaneous changed to text output.

[ 03/02/2019 - v2.7.3 ]
+ Improved JAVA Detection.
+ 3.10.1 scripts ( installs MongoDB 4.0.x ) ( MongoDB 4.0.x is not supported with the UniFi Network Controller ).
+ Addedd JAVA installed check.
+ Addedd MongoDB installed check.
* Miscellaneous changed to text output.

[ 19/02/2019 - v2.7.4 ]
* Improved free disk space check.

[ 23/02/2019 - v2.7.5 ]
* Y is now default.

[ 02/03/2019 - v2.7.6 ]
* Improved free disk space check.

[ 27/03/2019 - v2.7.7 ]
* Changed the MongoDB installation for Debian.
* Changed the Java 8 installation for Debian.

[ 08/04/2019 - v2.7.8 ]
+ Added check for wget.
+ Added check for netcat.
+ Added check if the controler can be reached on the public IP address.
* Fixed installations on Debian Stretch.
* Moved the required packages check to the start.
* Improved the installation check at the end of the script.
+ Added the installation scripts for Ubuntu 19.04 Disco Dingo

[ 16/04/2019 - v2.7.9 ]
* Fixed UniFi Video 3.10 Installation script for Ubuntu 19.04 and Debian 9.

[ 18/04/2019 - v2.8.0 ]
* Released Debian Buster Installation script ( Debian 10 ).
* Change IP Address catch
+ Added check for sudo.

[ 19/04/2019 - v2.8.1 ]
* Improved installation script for Debian Buster ( Debian 10 ).
+ Added an extra check.

 

 

 

Version History

 

Spoiler
[ v0.1 ]
+ Released the Easy Update Script

[ 19/11/2018 - v0.2 ]
* Changed OpenJDK install.

[ 21/11/2018 - v0.3 ]
* Fixed Architecture check.
* Minor change to the UniFi Installation File Check.

[ 21/11/2018 - v1.0 ]
+ JAVA 7 Detection/uninstall option.

[ 26/11/2018 - v1.0.1 ]
* Miscellaneous changes.

[ 11/12/2018 - v1.1 ]
+ Added support for Ubuntu 14.04 ( Trusty )
* Miscellaneous changes.

[ 22/12/2018 - v2.0 ]
+ Added support for Mint 18/19
* Improved JAVA Detection

[ 27/12/2018 - v2.0.1 ]
+ Added support for Linux MX 18.

[ 03/01/2019 - v2.1 ]
* Improved installed JAVA check.

[ 03/02/2019 - v2.2 ]
+ Database migration check.
* Cleaned up the update process.

[ 23/02/2019 - v2.3 ]
* Y is now default.

 

 

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
Member
Posts: 117
Registered: ‎10-24-2014
Kudos: 55
Solutions: 1

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

Just tried it on an 18.04 installation, worked great.

Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

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

Hello @Ash2761,

 

Awesome, thanks for the feedback!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
New Member
Posts: 5
Registered: ‎06-21-2015
Kudos: 1

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

Thank you so much for this! both work perfect!

Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

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

Hello @ambmiami,

 

You're welcome!

Thanks for your feedback!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
New Member
Posts: 31
Registered: ‎10-29-2016
Kudos: 3
Solutions: 1

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

Unpacking mongodb-org (3.4.17) ...
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_3.4.17_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_3.4.17_amd64.deb
/var/cache/apt/archives/mongodb-org-tools_3.4.17_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

########################################
# An error occurred. Aborting script.. #
########################################
Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

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

Hello @geadinc,

 

Thanks for reporting, what OS release do you have? (lsb_release -rs) 

Is it a clean installation?

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
New Member
Posts: 31
Registered: ‎10-29-2016
Kudos: 3
Solutions: 1

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

It was a brand new install of the latest Ubuntu 18.04. It completely trashed the OS so that nothing worked anymore. Every “apt-get” resulted in a mass of “broken pipe” errors. Nothing fixed it. Gave up and am now installing 16.04 again and now the boot block is corrupt and the machine won’t boot. Spend 4 hours on it last night, still not booting. 

Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

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

Hello @geadinc,

 

I will add the same checks as my UniFi SDN controller scripts, hope you will get your machine get to work.

 

 

Regards,

Glenn R.

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

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

Hi @AmazedMender16,

 

This looks great; had no idea people were doing this. Can you give some background on support for this solution? We need to upgrade past the 2TB limit of the Unifi NVR, and this looks like it could be a great soluton to this problem (i.e. Linux VM attached to a 12+TB NAS). Will it support software upgrades just like the NVR or will that be a manual process that relies on you updating your scripts?

 

Just don't want to move us across to an unsupported platform that will leave us at risk in 18 months time or such.

 

Thanks!

Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

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

[ Edited ]

Hello @lmorgan69a,

 

It basically install the unifi video that UBNT provides. I wrote them so people that don’t know linux well have a option for easy installation.

 

You can easily update unifi video thru the GUI, once its installed.

 

 

Regards,

Glenn R.

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

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

Hello Everyone,

 

I added the same checks as in my UniFi SDN controller installation scripts, please let me know how things go!

 

Feedback/reviews/kudos are always appreciated! Ubnt Banana

 

 

Regards,

Glenn R.

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

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

Hello Everyone,

 

Fixed the download links for ubuntu 18.04

 

 

Regards,

Glenn R.

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

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

Hello Everyone,

 

I released scripts for Debian 8/9 (Jessie and Stretch)

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
Emerging Member
Posts: 56
Registered: ‎06-22-2018
Kudos: 12
Solutions: 2

Re: UniFi-Video Installation Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9

Why not simply use normal Linux apt package management ?

 

On my Ubuntu 16.04 (xenial)  I did the following:

 

wget -O - http://www.ubnt.com/downloads/unifi-video/apt-3.x/unifi-video.gpg.key | sudo apt-key add -

sudo sh -c 'echo "deb [arch=amd64] http://www.ubnt.com/downloads/unifi-video/apt-3.x xenial ubiquiti" > /etc/apt/sources.list.d/unifi-video.list'

sudo apt update
sudo apt install unifi-video

 

and then simply update to latest unifi-video using the normal update procedure:

 

sudo apt update

sudo apt upgrade

 

replace "xenial" with the Ubuntu verion of your choice.

 

New Member
Posts: 1
Registered: ‎03-02-2017

Re: UniFi-Video Installation Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9

Clean install of 18.04, update, upgrade, reboot. followed instructions to get/run 18.04 script, went perfect! Thanks a bunch!

 

Was going to install the new 3.10 beta approved for 18.04, but this looked easier and headache free. 

Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

Re: UniFi-Video Installation Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9

Hello @jukasdrj,

 

Thanks for the feedback!

Glad it helped you out!

 

If you want the UniFi SDN script check my signature.

 

 

Regards,

Glenn R.

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

Re: UniFi-Video Installation Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9

Hello Everyone,

 

v2.2 Included a better MongoDB check.

Please let me know how things go! ( Error reports are appreciated! )

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
New Member
Posts: 24
Registered: ‎05-21-2016
Kudos: 3
Solutions: 1

Re: UniFi-Video Installation Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9

@

 

Thanks for this script, I am not a linux person, but am learning slowly, came home from work to look for  a walkthrough to install UBNT Video onto UBNT, and first post I came across was this, and everyone seems to be having great success with it, so first thing tomorrow I will have a go.

 

But first a question, and again "not a Linx man".  I was going to use 16.04 as I read some users had issues wth the latest 18.04.
That said is there any realtime benefits from using the Server version over the Desktop version ?

 

I do also have UniFi Controller but that runs off a cloud key.

 

I then need to figure out adding a 2nd disk of the same sort to do mirroring to give me peace of mind :-)

 

Thanks for the excellent work.

Senior Member
Posts: 21,509
Registered: ‎08-04-2017
Kudos: 4056
Solutions: 1044

Re: UniFi-Video Installation Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9

Hello @d95gas,

 

You're welcome!

The script will install the correct packages so it will work on Ubuntu 18.04, I personally still prefer using 16.04

 

For the disk, just do a quick google and you will find alot of guides and help articles Man Happy

 

 

Regards,

Glenn R.

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