Privateerr 🏴☠️
Privateerr packages the unmodified Private Internet Access (PIA) manual connection scripts in a lightweight Docker image. Use it with Gluetun and qBittorrent to create a VPN-protected download stack. The Privateerr container creates a PIA WireGuard configuration file for the Gluetun VPN container. Gluetun runs the VPN connection, and Privateerr’s built-in Python supervisor can refresh the configuration after a sustained outage.
🦜 Parrot says: Found this useful? Drop a ⭐ an' help another crew find the map.
─── ⛧ ───
🕵️ VPN in Tartarus? Summon the network necromancers in
Start with the three-container stack
| 🐳 Container |
🧭 What it does |
| 🏴☠️ Privateerr |
Creates the PIA WireGuard configuration file. Its built-in Python supervisor can refresh the configuration after a sustained VPN outage. |
| 🛡️ Gluetun |
Runs the VPN tunnel, firewall, DNS, and PIA port forwarding. |
| ⚓ qBittorrent |
Uses the Gluetun VPN container's connection for its network traffic. |
The quickstart below uses published images; you do not need to build an image. For a larger media stack, Plundarr generates the Compose project for you; Plundarrpedia guides the wider setup.
Quickstart
You need an active PIA subscription, Git, Docker with Compose, and openssl to generate a private API key. The supplied stack supports amd64 and arm64 hosts. Assume Docker is installed and running before starting.
Keep .env, generated VPN files, backups, and container logs private. Use a new checkout for this setup; generation can replace saved VPN files in an existing deployment.
-
Clone the project and create your settings file:
git clone --recurse-submodules https://github.com/scottgigawatt/privateerr.git
cd privateerr
cp example.env .env
-
Generate a key for the Privateerr container to communicate with the Gluetun VPN container:
openssl rand -hex 24
-
Open .env in a text editor. Replace the example values for the settings below; keep other defaults for the first launch.
| ⚙️ Setting |
✏️ What to enter |
| 🔐 PIA_USER |
Your PIA VPN username: p or P followed by seven digits, not your email address. |
| 🔒 PIA_PASS |
Your PIA VPN password. |
| 🔑 PRIVATEERR_GLUETUN_API_KEY |
The shared API key generated in step 2. |
| 👤 QBITTORRENT_PUID |
The user ID that should own qBittorrent's files; find it with id -u on the Docker host. |
| 👥 QBITTORRENT_PGID |
The group ID that should own qBittorrent's files; find it with id -g on the Docker host. |
| 🕒 QBITTORRENT_TZ |
Your time zone, such as America/New_York. |
| 📂 HOST_TORRENTS_DOWNLOADS_PATH |
Your host's downloads directory; the default is ./downloads/torrents. |
| 🔌 QBITTORRENT_WEBUI_PORT |
Keep 8080 unless that host port is already used. |
Keep PIA_VPN_PROTOCOL=wireguard, PIA_CONNECT=false, PRIVATEERR_KEEPALIVE=true, and PRIVATEERR_AUTO_RECOVER=true. The example selects a region that supports port forwarding. The Privateerr container and the Gluetun VPN container must mount the same host configuration directory, config/gluetun/. Keep their default directory settings for this first launch.
-
Check the Compose settings without printing credentials. Success produces no output:
docker compose --env-file .env config --quiet
-
Pull the published images, then start the three containers. Run the second command only after the pull succeeds:
docker compose --env-file .env pull privateerr gluetun qbittorrent
docker compose --env-file .env up --detach --no-build --pull never privateerr gluetun qbittorrent
-
Check startup:
docker compose ps
docker compose logs --tail 100 privateerr
Wait for Gluetun and qBittorrent to become healthy. Privateerr’s logs should show Automatic recovery enabled and then Gluetun tunnel is healthy; monitoring begins after a startup grace period. The Privateerr container’s healthy status means its configuration is ready for the Gluetun VPN container, so check Gluetun too. If startup fails, use the diagnostics.
-
Open qBittorrent at localhost:8080. If Docker runs on another computer or NAS, replace localhost with that host’s address; use your chosen port if you changed it. Find the initial password locally:
docker compose logs --tail 100 qbittorrent
Sign in as admin with the temporary password from the logs, then change it in Tools → Options → Web UI. Keep the logs private. You have reached the first working setup when the VPN is healthy and you can sign in to qBittorrent.
Buccaneerr is an optional test container and stays out of this startup. To stop the stack while keeping its settings and downloads, run docker compose down.
Create a PIA WireGuard configuration file
To use your own VPN client, run the published Privateerr image once. The Privateerr container writes wg0.conf, the PIA WireGuard configuration file, and matching PIA metadata to the mounted host directory, then exits. Save any existing configuration files before reusing that directory, and do not run multiple Privateerr containers against it at the same time. Creating these files does not start a VPN tunnel.
Choose your next step
Privateerr is Apache-2.0 licensed. PIA’s unmodified scripts retain their MIT license.
评论