This guide followed from :

This script will install openVPN with PiHole with all required iptables rules enabled. This script can install with Digitalocean Anchor IP too (10.15.xx.xx). So you could access the PiHole interface via your desired hostname.

1. UPDATE the server:

sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'

2. Download the OVPN installer from original OVPN source:

wget -O
chmod +x

3. For client user/password feature:

*Edit the installer to have password login feature:*
EASYRSA_CERT_EXPIRE=3650 ./easyrsa build-client-full "$client" nopass
EASYRSA_CERT_EXPIRE=3650 ./easyrsa build-client-full "$client"

4. RUN the installer:


5. Install PiHole

curl -sSL | bash

6. Set OVPN clients DNS to follow PiHole service

nano /etc/openvpn/server/server.conf

if any previous entries of " push "dhcp-option DNS xxxxx" "

push "dhcp-option DNS"

7. Finally restart both services Or better to reboot now.

pihole disable && pihole enable && systemctl restart openvpn-server@server

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.