Skip to content

Instantly share code, notes, and snippets.

@mcastelino
Last active September 24, 2022 07:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcastelino/fd4265be930182c53bb3eec0e7eb2eed to your computer and use it in GitHub Desktop.
Save mcastelino/fd4265be930182c53bb3eec0e7eb2eed to your computer and use it in GitHub Desktop.
How to upgrade Unifi Cloud Key 2 Firmware with Pi Hole

Last verified with

    Pi-hole v5.1.2 Web Interface v5.1.1 FTL v5.2
    Cloud Key firmware UCKG2.apq8053.v1.1.13.818cc5f.200430.0938

Instructions

#go superuser

sudo –i

#Let's install nano to make conf edit easier

apt-get install nano

#Install dnsmasq

apt-get update

apt-get install dnsmasq

#(Answer Y to replace the files as keeping the existing will point to 01-pihole.conf which does not work until pi-hole is installed)

# Ubiquiti switched the resolver to systemd-resolved which reserves the port 53

# dnsmasq install will fail to start dnsmasq so lets resolve that

sudo systemctl stop systemd-resolved

sudo systemctl disable systemd-resolved

sudo systemctl start dnsmasq

#Install pi-hole

cd /tmp

wget -O basic-install.sh https://install.pi-hole.net

#Install optional dependencies

#apt-get install man

#Install required dependencies

apt-get install whiptail

apt-get install dhcpcd5

apt-get install git

apt-get install dnsutils

apt-get install lsof

apt-get install unzip

apt-get install idn2

#downgrade libsqlite3 to support sqlite3

apt-get install libsqlite3-0=3.16.2-5+deb9u1

apt-get install sqlite3

apt-get install resolvconf

apt-get install lighttpd

apt-get install php-common

apt-get install php-cgi

apt-get install php-sqlite3

bash basic-install.sh

#Reconfigure lighttpd port to 8081

nano /etc/lighttpd/lighttpd.conf

#Restart lighttpd

/etc/init.d/lighttpd restart

#Change the pi-hole random password to your liking

pihole -a -p
  • Fix the php issue (valid only on older versions). If HTTP_HOST is not found, ignore this section.
/var/www/html/pihole/index.php

change

$serverName = htmlspecialchars($_SERVER["HTTP_HOST"]);

to

$serverName = htmlspecialchars($_SERVER["SERVER_ADDR"]);
@jeroeninhaarlem
Copy link

Anybody any luck updating the distro of the UCK g2 plus to debian 10 or 11 (so to match the glibc_2.28 requirement on the latest pihole-FTL) ?

@wijzijnwolf
Copy link

Workaround for issue with glibc_2.28 requirement: pi-hole/FTL#1420 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment