# Pia-tun

Pia-tun is a self-hosted network services app. Feature-rich PIA (Private Internet Access) WireGuard VPN container that automatically selects the lowest-latency server, applies a strict killswitch with zero-leak protection, syncs the forwarded port to qBittorrent,... It is open source and self-hosted, installable on Unraid.

Canonical page: https://ourlocalhost.com/app/7787/pia-tun

## Description

Feature-rich PIA (Private Internet Access) WireGuard VPN container that automatically selects the lowest-latency server, applies a strict killswitch with zero-leak protection, syncs the forwarded port to qBittorrent, Deluge, or Transmission, and exposes optional SOCKS5/HTTP proxies and DNS-over-TLS for other containers.

## Platform availability

Available on 1 of 10 platforms: Unraid.

## Health score

68/100 (Good), based on 4 of 5 factors.
- Maintained: 84 (last commit 3 days ago)
- Popular: 42 (132 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)
- Security check: 100 (no serious findings, CI, tests)

## Links

- Unraid: https://ca.unraid.net/apps/pia-tun-08vitk81xaru0s?q=pia-tun
- GitHub: https://github.com/x0lie/pia-tun

## Common questions

### Do I need to add a PIA auth token to my compose file?

No. The container acquires the auth token automatically and keeps it fresh. You provide PIA_USER and PIA_PASS as your credentials.

### How can other containers connect through the PIA tunnel?

Enable the optional SOCKS5 and HTTP proxy services so other machines or containers can use the VPN. Optional proxy authentication is supported.

### How do I sync the forwarded port to a torrent client?

Set PS_CLIENT to qbittorrent, deluge, or transmission to enable automatic port sync. You may also set PS_USER, PS_PASS, and PS_URL for that client.

### How do I allow access to downstream torrent WebUIs from my LAN?

Set LOCAL_NETWORKS to your LAN CIDR, such as 192.168.1.0/24, to allow downstream WebUI access.

### Does it work on minimal hosts?

Yes. It supports WireGuard userspace with wireguard-go and includes an iptables-legacy auto-fallback.

---
Source: Our Local Host (https://ourlocalhost.com/app/7787/pia-tun), the self-hosted and open-source app directory.
