piactl
Control Private Internet Access (PIA) VPN
TLDR
Log in to Private Internet Access
Connect to Private Internet Access
Disconnect from Private Internet Access
Enable or disable the Private Internet Access daemon in the background
List all available VPN regions
Display the current VPN region
Set your VPN region
Log out of Private Internet Access
SYNOPSIS
piactl [-h | -V] COMMAND [ARGS]
PARAMETERS
-h, --help
Print help information
-V, --version
Print version information
connect
Connect to VPN (auto-selects optimal server)
disconnect
Disconnect from VPN
get
Retrieve value(s) of config key(s); no args lists all
set
Set config key(s) to value(s); requires reconnect for some
login
Login to PIA account interactively
logout
Logout from PIA account
update
Check and apply PIA client updates
DESCRIPTION
piactl is the official command-line interface for managing the Private Internet Access (PIA) VPN client on Linux distributions. It enables users to connect, disconnect, configure servers, toggle privacy features, and query status without the graphical app, making it perfect for servers, scripts, and automation.
Key capabilities include selecting regions/servers, switching protocols (WireGuard/OpenVPN), enabling kill switch, port forwarding, split tunneling (lanallowlist), and MACE privacy protection. It reports connection details like VPN IP, endpoint, latency, and battery saver status on laptops.
piactl communicates with the user-level pia-client service, which must be installed via PIA's official .deb/.rpm packages and activated (often requiring initial GUI login). Commands are straightforward and chainable in scripts, e.g., check status before connecting.
Examples:
piactl connect — joins optimal server.
piactl set region US_New_York — picks location.
piactl get connectionstate region — fetches values.
Supports headless use after setup, with daemonized mode for persistence. Regularly updated with app releases for new servers and features.
CAVEATS
Requires PIA client installed/service running (systemctl --user start pia-client). Initial GUI setup/login often needed. Some set changes need reconnect. Runs per-user, not root.
COMMON KEYS (GET/SET)
connectionstate, region (e.g. US_New_York), protocol (wireguard/openvpn), killswitch (on/off), portforward (on/off), lanallowlist, strictmss; full list via piactl get
SERVICE MANAGEMENT
Enable: systemctl --user enable --now pia-client
Status: systemctl --user status pia-client
Logs: journalctl --user -u pia-client
HISTORY
Introduced in PIA Linux alpha (v77, 2020); stabilized in v3.x (2022+). Evolved with native client, adding WireGuard, port forward, and daemon support.


