On the QNAP
NOTE: A LXC container is used instead of a Docker container.
LXC containers are not just an application instance.
Docker containers run a single application installation.
Click on Advanced Settings.
Return to the Overview section in Container Station and after a few minutes you should see your container listed.
Click on the name of the container, which will enter the console.
Type passwd to change the password.
NOTE: The original password is ubuntu.
Update Ubuntu:
sudo apt update
Install the ssh server:
sudo apt install -y openssh-server
Add a username other than the default.
NOTE: Simply answer the prompts for the new user.
sudo adduser piuser
Grant the new user root privileges:
sudo usermod -aG sudo piuser
“ssh” to the new machine with the IP address that was used to create the LXC instance:
ssh piuser@192.168.1.25
Get privilege in the command window:
sudo -i
Install “curl”:
sudo apt install curl
Install pi-hole:
curl -sSL https://install.pi-hole.net | bash
ALERT: This option could be dangerous, as it simply runs a script downloaded from the web.
There is no guarantee that this script might contain a trojan etc.
To be extra secure, you could alternatively, just downloads the script using:
curl -sSL https://install.pi-hole.net -o pihole.sh
Then review the script yourself to ensure you are happy with it.
Then install it (making sure it has the right permissions to run).
chmod 777 pihole.sh bash pihole.sh
Select the defaults until the DNS screen and then choose Cloudflare as the DNS.
When you return to the prompt in the “ssh” terminal session, enter the following command to set your Pi-hole password:
pihole -a -p
NOTE: The “ssh” terminal session can now be closed.
Within a web browser, enter the IP address of your Pi-Hole followed by /admin:
http://192.168.1.25/admin
Click login and you should be able to log in with the password you just set.
NOTE: You will be able to start and stop the LXC container and reboot the QNAP NAS without any problems and even upgrade Pi-Hole when new releases are available.
IMPORTANT: Do not forget to set the DNS settings for your DHCP server on your router because Pi-Hole will not be used by any of your network clients until that occurs.
A good practice is to make the Pi-Hole DNS 1 and then Cloudflare 1.1.1.1 as DNS 2.
That will assure DNS translation when your Pi-Hole is not running.