Setting up wireguard+pihole with Ubuntu and other devices
The simplest+cheapest way I found to get a personal Wireguard VPN with Pihole.
- Get a $4/month Droplet on DigitalOcean with the Pihole+VPN (in the Marketplace). This automatically sets up Pihole with Wireguard support.
- Login to the droplet and run
./regen-vpn-keys.sh X
whereX
is the number of keys you want to generate. This will generate QR codes that you can load into your phone/iPad via the wireguard app. - Phone/iPad skips to step 4. Get it working on Ubuntu. Copy one of the interfaces to
/etc/wireguard/wg0.conf
. The full thing looks like:
[Interface]
Address = ...
DNS = ...
PrivateKey = ...
[Peer]
Endpoint = ...
PersistentKeepalive = ...
PublicKey = ...
PresharedKey = ...
AllowedIPs = ...
Now install wireguard:
sudo apt update
sudo apt install wireguard
Now, depending on the system you need to fix resolveconf:
sudo ln -s /usr/bin/resolvectl /usr/local/bin/resolvconf
- Now start wireguard! On the phone you just click a button. In Ubuntu you do:
sudo wg-quick up wg0
Get stats with
sudo wg show wg0
Turn it off with
sudo wg-quick down wg0
- Enjoy ad-less browsing with a VPN.