You've got a Raspberry Pi in a drawer and a plan: reach your NAS from anywhere, maybe block ads on your phone with Pi-hole. Everyone says PiVPN. Someone says it shut down. And your phone won't connect anyway.
What is a Raspberry Pi VPN server? A Raspberry Pi VPN server is a Pi on your home network that accepts encrypted connections from your phone or laptop, so you can reach devices at home and route traffic through your home connection from anywhere. Most people build one with PiVPN and WireGuard, a fast, modern VPN protocol.
Quick disclosure: we make a VPN app, which does a different job. Want your Pi to connect out to a VPN service? See the Windscribe section.
What Is PiVPN? (And Is It Still Maintained?)
PiVPN is a set of open-source scripts that installs a WireGuard (the default) or OpenVPN server on a Raspberry Pi, or a Debian or Ubuntu machine, and manages clients with one command, pivpn. It's still maintained, on what its maintainer calls a best-effort basis.
On April 5, 2024, PiVPN published v4.6.0, titled "The end," calling it "the final official release" and saying the repositories would be archived. Eight days later, v4.6.1 reversed course: "PiVPN will continue to be maintained on a best-effort basis by me." The repositories were never archived.

Best effort, per the maintainer: updates to keep it working on new distributions, big features only via pull requests, and issues without a debug log closed immediately. Releases since include Pi-hole v6 support (v4.9.0, February 2025), a Debian 13 "trixie" fix (v4.10.1, August 14, 2025) and v4.11.1 (September 13, 2025), the latest.
It works and ships fixes, but it's one person's best effort.
Checked October 2026.
First, what it will and won't do.
What a Raspberry Pi VPN Server Does (and Doesn't Do)
A Raspberry Pi VPN server brings you home. It gives your phone or laptop an encrypted tunnel to your house, so you can reach devices there, use your Pi-hole and browse with your home IP. It doesn't make you anonymous: websites see your home IP, and your home ISP sees your traffic as usual.
In a full tunnel, all traffic goes home first. In a split tunnel, only traffic for your home network does.
It's good for reaching your NAS, Plex or cameras without exposing them to the internet, safer browsing on untrusted Wi-Fi as far as your house, and your Pi-hole and home IP on the road. It won't put you in another country.
On café Wi-Fi, with a full tunnel and DNS inside it, the local network sees an encrypted connection to your home IP, plus timing and volume. Your home ISP sees what it would if you were home: destination IPs, timing and, depending on your setup, hostnames or DNS lookups, but not HTTPS contents.
The speed catch: in a full tunnel, everything you download enters your house, then leaves over your home upload, which often becomes your download ceiling. The extra trip adds latency.
As Windscribe co-founder Yegor Sak put it, roll your own VPN and "all your Internet activity is trivially linked to you" (why a self-hosted server ties everything back to you).
All of that assumes the internet can reach your house.
Before You Start: Hardware, a Reachable IP and the CGNAT Check
You need a Raspberry Pi on Ethernet, Raspberry Pi OS Lite, a fixed local address for the Pi, router access to forward one port, and a publicly reachable IP that reaches your router (IPv4, or IPv6 where both ends support it). That last one is the catch: carrier-grade NAT breaks ordinary port forwarding.
- A Pi. Any model in PiVPN's FAQ, ideally on Ethernet and already running around the clock, like a Pi-hole box.
- Raspberry Pi OS Lite. PiVPN recommends the latest image, which moved to Debian 13 "trixie" on October 2, 2025. PiVPN's v4.10.1 fixed trixie support, though its FAQ lists only Bullseye and Bookworm.
- A DHCP reservation, so your router always gives the Pi the same local address (PiVPN's FAQ reserves it by MAC address).
- Router access for port forwarding: sending incoming traffic on one port to one device inside your network.
- Dynamic DNS, a hostname that follows your home IP when it changes. PiVPN's FAQ names No-IP, FreeDNS and Duck DNS.
Are You Behind CGNAT? The One-Minute Check
Carrier-grade NAT (CGNAT) puts many customers behind one shared public IPv4 address (the kind the whole internet can reach), so you can't create an inbound mapping on your own router. No-IP's CGNAT explainer boils the check down to:
- Find the WAN (internet) IP on your router's status page.
- Compare it with what an IP lookup site shows.
- If they differ, or the WAN IP sits between 100.64.0.0 and 100.127.255.255 (the 100.64.0.0/10 block reserved for carrier NAT), there's at least one extra layer of NAT.
That's a strong hint, not proof: double NAT at home (an ISP modem plus your router) looks the same; PiVPN's FAQ says to forward the port on both.
Behind CGNAT? Ask your ISP for a public IP (sometimes paid), use IPv6 if you have a globally reachable address, a firewall rule allowing the connection and an IPv6-capable client network, or skip port forwarding with Tailscale (below).
Reachable? Then the install is the easy part.
How to Set Up a Raspberry Pi VPN Server With PiVPN and WireGuard
Flash Raspberry Pi OS Lite, give the Pi a fixed local address, run PiVPN's installer and choose WireGuard, forward UDP port 51820 to the Pi, then create a client with pivpn add and scan its QR code in the WireGuard app. Test from mobile data, not home Wi-Fi.
- Flash and update. Flash Raspberry Pi OS Lite with Imager, which can set your username and enable SSH first. SSH in, then update:
sudo apt update && sudo apt full-upgrade - Decide on Pi-hole now. Want it? Install Pi-hole first so PiVPN detects it.
- Run the installer as your normal user, with PiVPN's one-liner:
[ADD COMMAND 1 OF 2: the PiVPN one-liner from the Google Doc. Cloudflare blocks saving it, see notes]
Piping a script into bash runs it sight unseen. To read it first:
[ADD COMMAND 2 OF 2: the download-to-install.sh line from the Google Doc. Cloudflare blocks saving it, see notes]less install.sh
bash install.sh - Make the installer choices.
- IPv6 leak: Yes, if asked, so profiles route IPv6 into the tunnel.
- DHCP reservation: Yes, if you reserved the address on your router.
- Local user: your account, which holds the configs.
- Protocol: WireGuard.
- Port: 51820 by default, or any free port.
- DNS: your Pi-hole if detected, or any listed provider.
- Public IP or DNS: DNS Entry, if you set up dynamic DNS.
- Unattended upgrades: Yes. Anything with an open port should patch itself.
- Forward the port. Forward UDP 51820 (or your port) to the Pi's reserved address, usually under "port forwarding" or "virtual server." Forward nothing else.
- Add a client, named for the device in 15 characters or fewer:
pivpn add
pivpn -qr
Scan the QR code in the WireGuard app (garbled? use pivpn -qr -a256), or copy the .conf file from ~/configs to a laptop. Both hold the device's private key: treat them like passwords. - Test from outside. Turn off your phone's Wi-Fi, connect over mobile data, and run pivpn -c on the Pi: a time under Last Seen means a handshake (WireGuard's opening exchange) happened. Home Wi-Fi tests prove little: you're already inside, and some routers can't loop the connection back (hairpin NAT).
- Pick full or split tunnel. AllowedIPs, a client config line, decides which traffic uses the tunnel. A full tunnel needs both 0.0.0.0/0 and ::/0, or IPv6 can slip outside. A split tunnel lists your home subnet plus the VPN subnet (pivpnNET in /etc/pivpn/wireguard/setupVars.conf); set ALLOWED_IPS there to make new profiles split.
Working tunnel? Now make it block ads.
Add Pi-hole: Ad Blocking Through Your VPN
To use Pi-hole away from home, connect to your Raspberry Pi over WireGuard and set the client's DNS to the Pi-hole's VPN address. Install Pi-hole before PiVPN so the installer picks it up. Leave Pi-hole on "Allow only local requests," and never expose port 53, UDP or TCP, to the internet.
Pi-hole is a network-wide ad and tracker blocker that works as your DNS server.
Pi-hole installed first? PiVPN offers it as the VPN's DNS; say yes. PiVPN first? Set pivpnDNS1 in setupVars.conf to the Pi, delete pivpnDNS2, and fix the DNS = line in existing configs, per PiVPN's docs. Skip their pihole -a -i local step, a Pi-hole v5 command that Pi-hole v6 (February 2025) doesn't need.
The listening mode decides whom Pi-hole answers. The default, LOCAL ("Allow only local requests"), answers networks attached to the Pi, its WireGuard interface included, so PiVPN clients normally work. sudo pihole-FTL --config dns.listeningMode LOCAL restores it.
If the tunnel ends elsewhere, like your router, VPN clients look like outsiders; "Respond only on interface" or "Permit all origins" (Settings > DNS, Expert mode, Interface settings) fixes that. Pi-hole warns "Permit all origins" can create an open resolver, a DNS server anyone online can query and abuse for amplification attacks, so use either only behind a firewall blocking port 53, UDP and TCP, from the internet.
| Full tunnel + Pi-hole | DNS-only tunnel + Pi-hole | Pi-hole exposed to the internet | |
|---|---|---|---|
| Goes through the tunnel | Everything | DNS only | Nothing |
| Ads and trackers blocked | Yes | Yes | Yes, for anyone who finds it |
| Protects you on café Wi-Fi | Yes, as far as your house | No, only DNS is encrypted | No |
| Uses your home upload | For every download | A trickle | A trickle |
| Websites see | Your home IP | Your current network's IP | Your current network's IP |
| Verdict | Best on untrusted networks | Best for everyday mobile ad blocking | Don't: open resolver |
For everyday blocking, send only DNS home, as Pi-hole's WireGuard client example does. In a PiVPN profile using Pi-hole, copy the address from the DNS = line into AllowedIPs:
[Interface]
DNS = <Pi-hole address>
[Peer]
AllowedIPs = <same Pi-hole address>/32Everything else goes direct. DNS filtering can't catch ads served from the content's own domain, like YouTube's (what DNS-level blocking can't catch).
Something not working? You're in good company.
PiVPN Not Working? Fix Handshakes, DNS, LAN Access and QR Codes
Most PiVPN failures come from four places: the path to the Pi (no handshake), DNS or MTU (connected, nothing loads), AllowedIPs or overlapping subnets (home devices unreachable), and terminal or app quirks (QR code won't scan). Run pivpn -d first, then test from mobile data.

A handshake is WireGuard's opening exchange; no recent one in pivpn -c means packets aren't reaching the Pi or getting back. pivpn -d, PiVPN's self-check, should show every line OK and offers to fix some errors. Redact your public IP and keys before sharing its output.
| Symptom | Likely cause | Fix |
|---|---|---|
| No handshake, ever | Port not forwarded, wrong Pi address, double NAT or CGNAT; less often bad keys, a wrong Endpoint or blocked UDP | Forward to the Pi's reserved IP, on both routers if you have two; run the CGNAT check; regenerate with pivpn add |
| No handshake after it worked | Public IP changed | Update pivpnHOST and clients' Endpoint, or use dynamic DNS |
| Handshake, nothing loads | Usually a bad DNS = line; sometimes MTU | Fix DNS or Pi-hole's listening mode; then set MTU = 1420 under [Interface], lowering by 10 until pages load |
| Websites load, home devices don't | AllowedIPs lacks your home subnet, or both networks share a range | Add the subnet; move home to a less common range |
| Drops when idle | Client-side NAT timeout | PersistentKeepalive = 25 under [Peer] |
| Tunnel won't switch on | Another VPN is active | Turn it off; phones generally run one at a time |
| QR code garbled | Terminal rendering | pivpn -qr -a256, or copy the .conf |
No Packets at All
PiVPN's FAQ uses a packet capture here. Swap in your interface and port, then connect from mobile data:
sudo apt install tcpdump
sudo tcpdump -n -i eth0 udp port 51820Nothing shows up? The problem is upstream: the port forward, double NAT or CGNAT. Packets in but none out points to routing, blocking or poor connectivity, so try another network.
It Worked Yesterday
Your public IP probably changed: compare curl -s https://checkip.amazonaws.com with pivpnHOST in setupVars.conf. After an OS upgrade, run pivpn -d, then pivpn -up. Once fixed, test for DNS leaks.
Working? Spend five minutes keeping it yours.
Lock It Down: Five Security Basics for a Pi VPN Server
A Raspberry Pi VPN server faces the internet, so five basics keep it yours: forward one port only, keep it patched, give each device its own profile, guard configs and backups like passwords, and use SSH only from inside your network, with keys.
- Expose one port, and only one. UDP 51820 or your chosen port; never SSH, port 53 (UDP or TCP) or Pi-hole's web interface.
- Keep it patched. Unattended upgrades on, plus an occasional pivpn -up.
- One profile per device. Run pivpn remove for a lost or sold phone.
- Treat configs, QR codes and backups as passwords. Each holds a private key; pivpn -bk archives them all.
- SSH with keys, from inside. Set up key login, then disable password logins. Away? Connect to the VPN, then SSH to the Pi's local address.
Can't forward a port? There's another way in.
PiVPN or Tailscale?
Choose PiVPN if you can forward a port and want a server you fully control with no outside account. Choose Tailscale on the Pi if you're behind CGNAT, can't touch the router, or want every device connected without port forwarding, and you're comfortable with a third-party coordination service and an account.
Tailscale is a mesh VPN built on WireGuard: devices make outbound connections and find each other through its coordination service, so nothing needs a forwarded port. Failed direct connections fall back to encrypted relays.
On a Pi, a subnet router shares your home network: enable IP forwarding (subnet router docs), advertise your subnet (Raspberry Pi guide), then approve the route in the admin console:
sudo tailscale set --advertise-routes=192.168.1.0/24An exit node sends all traffic through the Pi, like a full tunnel. For Pi-hole, Tailscale's guide uses "Permit all origins" and the Pi as a custom nameserver, so keep that Pi behind a firewall. As of October 2026, the free Personal plan covers up to six users and unlimited user devices for non-commercial use.
| PiVPN (WireGuard) | Tailscale on a Pi | |
|---|---|---|
| Needs a port forward and public IP | Yes | No |
| Works behind CGNAT | No | Yes |
| Outside account or service | None | Tailscale account and coordination service |
| Reach your home network | AllowedIPs with your subnet | Subnet router |
| Send all traffic home | Full tunnel | Exit node |
| Pi-hole for remote devices | DNS line in each config | Custom nameserver |
| Maintained by | One maintainer, best effort | A company |
| Clients | Any WireGuard app | Tailscale apps |
You can run both: PiVPN for your devices, Tailscale for ones that can't reach the forwarded port. It's one of several virtual LAN tools for linking specific devices.
Not sold on either? There are other routes.
PiVPN Alternatives
If you'd rather not depend on PiVPN, you can set up WireGuard by hand, run a WireGuard server in Docker with a web interface, use the VPN server built into some home routers, or use a mesh tool like Tailscale. Each trades convenience for control, or the reverse.
- Plain WireGuard, by hand. No scripts, more typing (WireGuard's quickstart).
- WireGuard in Docker. Some container setups add a web page for managing clients.
- Your router's VPN server. Support, updates and IPv6 handling vary by model, and CGNAT still applies. Not the same as a VPN client on your router.
- Tailscale, or another mesh tool. No port forwarding.
- OpenVPN through PiVPN. Rerun the installer to add it as the fallback when a network blocks WireGuard's UDP.
One question left: where does a VPN like ours fit?
Where Windscribe Fits (and Where It Doesn't)
Your Pi brings you home. Windscribe is an outbound privacy VPN: it encrypts traffic between your device and Windscribe, then sends it out from a Windscribe exit IP typically shared with other users, which a home server can't give you. It isn't built to route you back into your home network.
Its Static IPs and port forwarding expose services through a Windscribe connection; they don't replace hosting your own home VPN server.
Windscribe's Windows, macOS and Linux desktop apps can import a WireGuard config as a location, even without a Windscribe account, so home and Windscribe share one app, one connection at a time. On phones, you switch apps. R.O.B.E.R.T., Windscribe's DNS-level blocker, is the no-hardware Pi-hole alternative while you're connected to Windscribe; the free plan includes the Malware and Ads + Trackers lists and up to three custom rules.
Want the Pi itself on Windscribe? There are builds for Debian and Ubuntu on AARCH64 and AMD64, with Windscribe's Linux CLI for headless use. Raspberry Pi OS isn't officially supported, and there's no 32-bit ARM build.
Just want ad blocking and safer public Wi-Fi? You may not need a Pi. Want to reach home? You do.
Be Smart
A Raspberry Pi running PiVPN and WireGuard is one of the simplest ways to reach your home network from anywhere, if your connection accepts inbound traffic. Check for CGNAT first, keep Pi-hole on its default listening mode, expose one port, and if you can't forward it, put Tailscale on the Pi. It brings you home; it doesn't make you anonymous.
Want ad blocking and a safer connection on public Wi-Fi without running a server? Try Windscribe Free.
Raspberry Pi VPN Server FAQ
Is PiVPN still maintained?
Yes, on a best-effort basis. The maintainer announced the end in April 2024, reversed course eight days later, and has shipped releases since, including a Debian 13 (trixie) fix in August 2025. Big new features are unlikely. Checked October 2026.
Does a Raspberry Pi VPN server hide my IP address?
It swaps your current network for your home connection. Websites see your home IP, not the café's; your home ISP sees destinations and timing as usual, not HTTPS contents. It encrypts the hop to your house but isn't an anonymity tool.
Do I need a static IP for a Raspberry Pi VPN server?
No, but you need a publicly reachable IP (IPv4, or IPv6 where both ends support it) that reaches your router. Dynamic DNS follows it when it changes, but can't fix CGNAT, where your ISP shares one public IP among many customers.
Will PiVPN work behind CGNAT, Starlink or mobile broadband?
Not with ordinary port forwarding. Mobile broadband often uses CGNAT, though not always; Starlink uses it by default, with a public IP as an opt-in on some Priority plans. Ask for a public IP, try IPv6 if both ends support it, or run Tailscale on the Pi.
Should I use WireGuard or OpenVPN on a Raspberry Pi?
For most people, WireGuard, PiVPN's default: fewer settings to get wrong, and lighter on the Pi. Keep OpenVPN for networks that block UDP, since OpenVPN can run over TCP and WireGuard can't. Our OpenVPN vs WireGuard comparison covers the rest.
Can I use Pi-hole away from home without a VPN?
Not safely. Exposing Pi-hole's DNS port (53, UDP or TCP) to the internet makes it an open resolver that attackers can abuse for amplification attacks. Connect over WireGuard instead, where a DNS-only tunnel uses very little data, or use Tailscale.
Can I use my Raspberry Pi VPN and Windscribe at the same time?
Not at once, but you can switch. Phones generally run one device-wide VPN at a time, so you toggle between your home tunnel and Windscribe. On a computer, the Windscribe desktop app can import your PiVPN config, so both live in one app.