Fork me on GitHub

Herr Knedel/Great things with containers: Pihole on Synology Diskstation

Created Mon, 01 Feb 2021 00:00:00 +0000 Modified Mon, 28 Mar 2022 18:10:18 +0000 Difficulty level: It may take a little longer

224 Words

Today I show how to install a Pihole service on the Synology disk station and connect it to the Fritzbox.

Step 1: Prepare Synology

The first thing to do is to enable SSH login on Diskstation. To do this, go to the “Control Panel” > “Terminal

After that you can log in via “SSH”, the specified port and the administrator password (Windows users take Putty or WinSCP). I log in via Terminal, winSCP or Putty and leave this console open for later.

Step 2: Create Pihole folder

I create a new directory called “pihole” in the Docker directory.

Then I change to the new directory and create two folders “etc-pihole” and “etc-dnsmasq.d”:
x
+
Terminal

$ cd /volume1/docker/
$ mkdir -p {etc-pihole,etc-dnsmasq.d}

Now the following Docker Compose file named “pihole.yml” must be placed in the Pihole directory:

version: "3"

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "8080:80/tcp"
    environment:
      TZ: 'Europe/Berlin'
      WEBPASSWORD: 'password'
    volumes:
      - './etc-pihole/:/etc/pihole/'
      - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

The container can now be started:

x
+
Terminal

$ sudo docker-compose up -d

I call the Pihole server with the Synology IP address and my container port and log in with the WEBPASSWORD password. Now the DNS address can be changed in the Fritzbox under “Home Network” > “Network” > “Network Settings”.