Senior Member
Posts: 13,063
Registered: ‎08-04-2017
Kudos: 2217
Solutions: 640
UniFi Installation Scripts | UniFi Easy Update Scripts | Ubuntu 18.04 and 16.04 | Debian 8 and 9
[ Edited ]

Hello guys!

 

I wrote some scritps that will install/Update the UniFi Controller software on your Ubuntu/Debian machines. These scripts were tested on Ubuntu 16.04/18.04/18.10 and Debian 8/9. If you find any issues while using my scripts please let me know!

 

Information about the UniFi Controller Versions.

 

I recommend using server with atleast 2 GB of RAM.

 

 

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) Execute the following commands to download the script. (change it to your wanted version)

wget https://get.glennr.nl/unifi/5.9.29/U1604/unifi-5.9.29.sh; chmod +x unifi-5.9.29.sh

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

./unifi-5.9.29.sh

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

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

6) Kudo my post Man Happy

 

 

5.6.x

 

Installation script for UniFi 5.6.40 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi 5.6.40 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi 5.6.40 - Ubuntu 18.10

Installation script for UniFi 5.6.40 - Debian 8

Installation script for UniFi 5.6.40 - Debian 9 ( MX 18 )

 

 

5.8.x

 

Installation script for UniFi 5.8.30 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi 5.8.30 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi 5.8.30 - Ubuntu 18.10

Installation script for UniFi 5.8.30 - Debian 8

Installation script for UniFi 5.8.30 - Debian 9 ( MX 18 )

 

 

5.9.x

 

Installation script for UniFi 5.9.29 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi 5.9.29 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi 5.9.29 - Ubuntu 18.10

Installation script for UniFi 5.9.29 - Debian 8

Installation script for UniFi 5.9.29 - Debian 9 ( MX 18 )

 

Old Installation Scripts

 

Spoiler

5.6.x

 

Installation script for UniFi 5.6.37 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi 5.6.37 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi 5.6.37 - Ubuntu 18.10

Installation script for UniFi 5.6.37 - Debian 8

Installation script for UniFi 5.6.37 - Debian 9 ( MX 18 )

 

Installation script for UniFi 5.6.39 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi 5.6.39 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi 5.6.39 - Ubuntu 18.10

Installation script for UniFi 5.6.39 - Debian 8

Installation script for UniFi 5.6.39 - Debian 9 ( MX 18 )

 

5.8.x

 

Installation script for UniFi 5.8.24 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi 5.8.24 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi 5.8.24 - Ubuntu 18.10

Installation script for UniFi 5.8.24 - Debian 8

Installation script for UniFi 5.8.24 - Debian 9 ( MX 18 )

 

Installation script for UniFi 5.8.28 - Ubuntu 16.04 ( Mint 18 )

Installation script for UniFi 5.8.28 - Ubuntu 18.04 ( Mint 19 )

Installation script for UniFi 5.8.28 - Ubuntu 18.10

Installation script for UniFi 5.8.28 - Debian 8

Installation script for UniFi 5.8.28 - Debian 9 ( MX 18 )

 

Version History

 

Spoiler
[ 6/4/2018 - v1 ]
+ Released the Installation Scripts

[ 6/4/2018 - v1.1 ]
+ Added Error check

[ 6/8/2018 - v1.1.1 ]
+ Added Stable Candidate 5.8.21 installation script
* Fixed download links, sorry!

[ 6/18/2018 - v1.1.1 ]
+ Added Stable Candidate 5.8.23 installation script

[ 6/27/2018 - v1.2 ]
- Removed 5.7.x controllers since they became unsupported.
* Fixed some issues with the installation scripts.

[ 6/27/2018 - v1.3 ]
+ UniFi dependency install

[ 7/2/2018 - v1.3 ]
+ Added UniFi 5.8.24 Stable installation script

[ 7/13/2018 - v1.4 ]
+ Added a option to chose if you want to be able to update the controller version using "apt update && apt upgrade"

[ 7/17/2018 - v1.5 ]
* Fixed errors were some people ran into. (curl & software-properties-common)

[ 9/8/2018 - v1.6 ]
* Fixed a common reported issue when jsvc couldn't be installed.

[ 10/8/2018 - v1.7 ]
* Fixes a unneeded dialog if you didn't have any issues regarding to jsvc!

[ 21/8/2018 - v1.8 ]
+ Added the same check in the 16.04 scripts as in 18.04 scripts for JSVC.

[ 21/8/2018 - v1.9 ]
* Fixed typos made in the scripts.

[ 17/9/2018 - v2.0 ]
+ Support for Ubuntu 16.04 32 bit

[ 17/9/2018 - v2.1 ]
* Fixed typos in some 5.6.x scripts

[ 8/10/2018 - v3.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 - v3.1 ]
+ Debian 8/9 scripts

[ 13/10/2018 - v3.1.1 ]
* Fixed upgrade loop when unifi was already installed

[ 14/10/2018 - v3.1.2 ]
* Fixed a check.

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

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

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

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

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

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

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

[ 20/10/2018 - v3.4.3 ]
* Improved a check.

[ 22/10/2018 - v3.4.4 ]
* Changed to the MongoDB check.

[ 25/10/2018 - v3.5 ]
+ Swap file creation depending on available memory.
* Changed MongoDB checks.
* Fixed OS Release check.

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

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

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

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

[ 14/12/2018 - v3.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 - v3.5.6 ]
* Minor changes to OS detection.

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

[ 27/12/2018 - v3.6.1 ]
+ Added support for Linux MX 18.

[ 28/12/2018 - v3.7 ]
+ Added service enabled check.
* Improved 64 bit detection.
* Improved MongoDB 32 bit installation. ( Ubuntu 16.04 )
* Miscellaneous changed to text output.

[ 03/01/2019 - v3.7.1 ]
* Improved service check.

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

 

 

 

 

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

This script includes a solution for updating from 5.0.x to the latest controller versions

 

You can download the script HERE

 

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) Execute the following commands to download the script.

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

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

./unifi-update.sh

5) Kudo my post Man Happy

 

Version History

 

Spoiler
[ v1 ]
+ Released the Easy Update Script

[ v1.1 ]
* Improved checks

[ v2 ]
* Rewrote the Easy Update Script
+ Version menu

[ v2.1 ]
* Fixed checks

[ v2.2 ]
* Now only displays 1 IP if the server has multiple.

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

[ 16/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.
* Improved JAVA check.

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

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

[ 29/10/2018 - v2.4.3 ]
* Script will now pause 60 seconds instead of 30.

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

[ 16/11/2018 - v2.5 ]
* General Improvements.

[ 19/11/2018 - v2.5.1 ]
* Changed OpenJDK install.

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

[ 21/11/2018 - v2.6 ]
+ JAVA 7 Detection/uninstall option.

[ 26/11/2018 - v2.6.1 ]
* Miscellaneous changes.

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

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

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

[ 28/12/2018 - v2.7.3 ]
* Improved JAVA detection.

 

 

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 3x • 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-PLUS • UCK-G2 • UCK
Who Me Too'd this topic