Skip to content

Uninstall

Removing OpenVPN

To completely remove OpenVPN and all associated configuration:

sudo ./openvpn-install.sh uninstall

What Gets Removed

The uninstall process removes:

  1. OpenVPN packages — the openvpn package and dependencies
  2. Configuration files — /etc/openvpn/server/ directory
  3. PKI infrastructure — CA, server and client certificates
  4. Firewall rules — all OpenVPN-related firewall rules (see Firewall — Cleanup on Uninstall)
    • firewalld: port, plus the dedicated policy and zone (or legacy masquerade/rich rules for installations created before the access-policy system)
    • nftables: /etc/nftables/openvpn.nft
    • iptables: scripts and systemd service
  5. Sysctl settings — /etc/sysctl.d/99-openvpn.conf
  6. Systemd service — openvpn-server@server.service
  7. Unbound DNS — if it was installed by the script
  8. SELinux rules — if SELinux port rules were added

Data loss warning

Uninstallation deletes all certificates and keys permanently. Client .ovpn files in users' home directories are not removed, but they will no longer work.

Reinstallation

After uninstalling, you can run the installation again:

sudo ./openvpn-install.sh install

A completely fresh PKI infrastructure will be created. All clients will need new .ovpn files.