OpenVPN + Pihole
OpenVPN + Pihole
by Shark Labs

Version 1.1.1

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

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! (ن╹◡╹)੭”

NB: OpenVPN and Pi-hole can take several minutes after first boot to be fully
setup and configured.

Once initial setup is complete, 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 least once every 3 months. This helps ensure
you're running the latest software.

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

    pihole -a -p  # Command available after first boot setup is complete

ヾ(^_^) 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"}' \

Support Details

Supported By:Shark Labs
Support URL:

More DigitalOcean Links

DigitalOcean Community

Developers supporting developers

Ask a Question

Ask anything related to system administration, programming, devops, open source, or the DigitalOcean platform.

List your 1-Click App in the DigitalOcean Marketplace

Partner with us to build traction for your open source project or software company