Back to projects

PVPN: Per-App VPN Tunnel Controller for Linux

Route only the apps you choose through a VPN. Everything else stays on your normal connection.

Overview

PVPN is a lightweight Linux tool that creates an isolated, VPN-only lane for specific applications. Instead of pushing the whole system through a VPN, you pick which apps (a browser, a messenger, anything) should be protected. They run inside a sandboxed network space that can only reach the internet through the VPN tunnel. The rest of the machine is untouched.

It is controlled from a system tray icon that opens a fast, keyboard-driven terminal control panel right above the taskbar.

The problem it solves

On Linux, sending only a few chosen apps through a VPN (per-app split tunneling) is hard to get without paying a monthly subscription. As of October 2026, the main options are:

  • Proton VPN: split tunneling on Linux is a paid-plan feature, only in the official Ubuntu and Fedora apps, not the Flatpak version, and the kill switch is unavailable while it is on.
  • Mullvad: per-app split tunneling on Linux, but it is a paid monthly service, and it can only exclude apps from the VPN. It can't send only chosen apps through it.
  • Windscribe: per-app split tunneling is available on the free tier, but the free tier is capped at 10 GB of data per month. Beyond that it needs a paid plan.
  • NordVPN: on Linux it only allows exceptions by port or subnet, not by app.

The do-it-yourself route means manual routing rules, fragile scripts, or running commands as root every time. PVPN routes only the apps you choose through the VPN, using the Proton VPN config files you already have, with no extra subscription for the split-tunnel feature itself. It turns that into one click and one keypress.

What PVPN is (and isn't)

  • It is not a VPN service. It doesn't provide servers or a VPN connection of its own.
  • It relies on Proton VPN config files. You download them from your Proton VPN account, and PVPN uses them to open the tunnel.
  • It is the controller around that connection: it decides which apps go through the tunnel and keeps every other app on the normal connection.

Architecture

The tray daemon opens the control panel, and the launcher starts protected apps inside a dedicated network namespace. Inside it, the only route out is the Proton VPN tunnel, run as a systemd service. Apps outside PVPN keep using the normal connection.

PVPN ARCHITECTURE Only chosen apps enter the VPN-only lane. Everything else stays on the normal connection. CONTROL TRAY ICON Tray daemon Python · DBus · KDE StatusNotifierItem TUI PANEL Control panel curses · one key toggles the VPN LAUNCHER App launcher checks the tunnel is up at launch time launch NETWORK NAMESPACE · VPN-ONLY LANE Browser Messenger Up to 9 apps TUNNEL · tun0 Proton VPN tunnel systemd service · auto-restart No tunnel, no launch: apps cannot bypass it isolated namespace · leak protection VPN SERVER Proton VPN switch between Proton config files EVERYTHING ELSE Other apps normal connection, untouched INTERNET Outside world protected apps arrive via the VPN
Protected apps live in a VPN-only namespace; everything else is untouched.

Key features

Per-app isolation

Only apps launched through PVPN use the VPN. Each one runs inside a dedicated, isolated network namespace.

Tray icon controller

Lives in the KDE taskbar. One click opens or closes the control panel, and it starts automatically at login.

Keyboard-first TUI

A compact terminal interface: one key toggles the VPN, and number keys launch protected apps instantly.

Leak protection

Apps can't launch unless the tunnel is verified as actually up, not just "service running". The status is checked fresh at the moment of launch.

Multiple VPN configs

Drop in Proton VPN config files and switch between servers from the menu.

Custom app list

Up to 9 apps, set in a simple text file. Changes are picked up automatically, with no restart or reinstall.

Runs in the background

The VPN stays connected after the panel closes, and launched apps survive the panel closing.

Auto-recovery

The tunnel restarts automatically if it drops.

Built-in diagnostics

One screen checks dependencies, tunnel state, file permissions, and config status, with clear OK / WARN / FAIL results.

Log viewer and one-key reset

App and tunnel logs are viewable inside the TUI. One key clears stuck state, stops the tunnel, and closes protected apps in about 2 seconds, with no reboot.

Security design

True isolation

Protected apps are confined to their own network namespace and can't bypass the tunnel.

No hardcoded credentials

VPN login details live in a private, owner-only file and are never embedded in the tool.

Minimal privileges

Tightly scoped permissions instead of blanket root access. No password prompts during normal use.

Unprivileged status checks

The frontend never needs elevated rights to know whether the VPN is connected, which avoids a whole class of permission bugs.

Locked-down config directory

No other local user can read the configs, credentials, or logs.

Tech stack

  • Python · curses TUI
  • Python · DBus tray daemon
  • Bash
  • systemd
  • Proton VPN config files
  • Linux network namespaces
  • KDE StatusNotifierItem

Built and tested on CachyOS (Arch-based) with KDE Plasma 6. It uses Proton VPN config files.

Development story

The project went through three versions. It started as a one-shot Bash script. Version 2 became a menu-driven tool with a background service, and version 3 is the current tray-plus-TUI design.

Along the way, a full Qt GUI was built and abandoned after KDE's window manager kept fighting its window placement. The terminal-based approach turned out faster, lighter, and more reliable. The longest debugging arc was an intermittent permission failure. It was solved by redesigning how connection status is reported, rather than patching around the symptom.

Known limitations

  • Runs native Linux applications only. Flatpak apps have been tested and don't work inside the VPN lane yet (they use their own sandbox); no solution has been found so far.
  • Relies on Proton VPN config files. Other VPN providers haven't been tested.
  • Multi-monitor panel positioning hasn't been tested yet.
  • Tuned for KDE Plasma. Other desktops should work through a fallback tray mode but haven't been verified.
  • The taskbar entry shows the terminal's default icon. This is cosmetic only.

Roadmap

  • WireGuard support
  • OpenVPN support, so config files from other VPN providers can be used, not only Proton VPN
  • Support for free VPN tools and services