The other day I bought myself a Gen2 cloudkey plus from Ubiquiti and replace my old cloudkey. It comes installed with the Unifi SDN and the new Unifi Protect. The device looks really nice and has a little display which shows you information about the applications running on the device.
Since I have been playing with pi-hole lately on one of my Raspberry Pi’s, I was wondering if I could install pi-hole on the cloudkey so I would have everything from my network on a central place. With help of Google I managed to get it working by following the steps below:
First you have to install a DNS server on the cloudkey, since that’s used by the pi-hole software. ssh into your cloudkey and enter the following commands:
apt-get install dnsmasq
Than we can install the pi-hole software. I choose to download the install script and execute it on my device.
wget -O basic-install.sh https://install.pi-hole.net
Keep all the defaults. the only thing I had to do was say no to keep the ip address from DHCP since it didn’t copy the IP adres, I entered it myself. During the install the lighttpd webservice will be installed too. This is used by the admin page.
Last thing is to change the default port of the website since that’s already taken by the cloudkey management interface. During pihole install lighttpd was installed
make a backup of the config:
cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.backup
sed -ie ‘s/= 80/= 81/g’ /etc/lighttpd/lighttpd.conf
or use vi/nano to edit the config file and change the server port
restart the webserver
http://<IP>:81/admin should bring up the pi-hole interface
Every time you run the pihole install you have to set the port of the webserver back to a non 80 port again
Let me know if this works for you or if I forgot to document a step.