OpenVPN + Pihole
OpenVPN + Pihole
by Shark Labs


OS Ubuntu 18.04


A useful combination for travellers and safety online - OpenVPN and Pihole together - to quickly protect you and your data from unwanted surveillance and unexpected malware domains, all of which is especially useful while traveling and on public wifi.

Software Included

OpenVPN2.4.4-2ubuntu1.3GPL v2

Getting started after deploying OpenVPN + Pihole

To use your new OpenVPN + Pihole server, you'll need to collect your OpenVPN config one time. Do this by logging into your new 1-Click App Droplet via ssh root@your_Droplet_IP with your SSH key or one-time password. You'll then see and follow this MOTD:

hiya! (ن╹◡╹)੭”

Your client config can be found at:


Securely copy your config to your device and import it into your client app.

To create an additional client configuration run:

    /root/ client2

NOTE: Certs are only valid for 90 days, so you will need to delete your
droplet and create a new one at lest once every 3 months. This helps ensure
you're running the latest software.

To access the Pihole dashboard, connect to the VPN and visit: pi.hole/admin.
To set / reset the admin password run:

    pihole -a -p

ヾ(^_^) Happy travels Road Warrior, and if you like this tool, consider
donating to the authors from which this work is derived:

You can also check out this short demo of configuring and setting everything up from an Android device.

To spin up and tear down your VPN server on demand so that you only pay for the compute resources when you are using them, check out the example client scripts in the source repo that can be executed directly from a terminal emulator like Termux on your mobile device.

API Creation

In addition to creating a Droplet from the OpenVPN + Pihole 1-Click App via the control panel, you can also use the DigitalOcean API.

As an example, to create a 4GB OpenVPN + Pihole Droplet in the SFO2 region, you can use the following curl command. You’ll need to either save your API access token to an environment variable or substitute it into the command below.

  curl -X POST -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer '$TOKEN'' -d \
      '{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image":"pihole-18-04"}' \

More DigitalOcean Links

Product Docs

Technical overviews, how-tos, release notes, and support material


DevOps and development guidelines

API Docs

Run your resources programmatically

Ask a question

Connect, share and learn