How to choose, use and configure a VPN in CentOS (Guide)

Running CentOS in a corporate or homelab environment often means you need a VPN solution that plays nicely with RHEL’s package ecosystem, SELinux policies and systemd-managed services. Below is a rundown of three of the top contenders—each offering an RPM-based client, solid protocol support and straightforward integration into CentOS 7/8/Stream.

Why These VPNs Are Ideal for CentOS

  • RPM Packaging Repositories: CentOS uses yum (7) or dnf (8/Stream) and relies on RPM packages. All of the below vendors supply an official .rpm or distro-compatible repo.
  • SELinux-Friendly: Proper file contexts and systemd units are provided out of the box, avoiding overly permissive workarounds.
  • Server-Grade Stability: Many CentOS users run headless servers or remote desktop environments (GNOME, KDE via EPEL, Xfce). CLI tools and systemd integration are a must.
  • Networking Peculiarities: CentOS kernels often ship with strong sysctl defaults for routing, firewalld/zones and kernel modules. VPN clients must integrate with NetworkManager or provide reliable routing scripts.

Feature Comparison

VPN Provider Protocols CentOS Support Repo / Package Notes
NordVPN OpenVPN, IKEv2/IPsec, NordLynx 7 amp 8/Stream Official RPM repo SELinux policy included systemd service
ExpressVPN OpenVPN, Lightway, L2TP/IPsec 7 amp 8/Stream Official RPM installs expressvpn CLI Lightway is very fast on RHEL kernels
ProtonVPN OpenVPN, WireGuard 7 amp 8/Stream Official RPM repo Python-based CLI WireGuard support via kernel module

Installation Configuration Guides

NordVPN

NordVPN provides an official repository that works on CentOS 7, 8 and Stream. It installs a nordvpn CLI which can be controlled via systemd.

1. Add the repository and import keys

yum install -y yum-utils
yum-config-manager --add-repo https://repo.nordvpn.com/yum/nordvpn.repo
rpm --import https://repo.nordvpn.com/gpg/nordvpn_public.asc
  

2. Install the client and log in

yum install -y nordvpn
nordvpn login
  

3. Enable SELinux contexts (if required)

# This step is usually preconfigured, but if you run into AVC denials:
yum install -y policycoreutils-python
semanage fcontext -a -t etc_t /etc/nordvpn(/.)?
restorecon -Rv /etc/nordvpn
  

4. Connect and set defaults

# Connect to the nearest server:
nordvpn connect
# Or set protocol and autostart:
nordvpn set technology NordLynx
nordvpn set autoconnect on
  

ExpressVPN

ExpressVPN’s RPM installs a CLI named expressvpn which integrates with systemd. The Lightway protocol offers impressive throughput on RHEL-based kernels.

1. Download and install the RPM

# For CentOS 7
curl -O https://www.expressvpn.works/clients/linux/expressvpn-3.21.0.4-1.x86_64.rpm
yum install -y expressvpn-3.21.0.4-1.x86_64.rpm

# For CentOS 8 / Stream
curl -O https://www.expressvpn.works/clients/linux/expressvpn-3.21.0.4-1.x86_64.rpm
dnf install -y expressvpn-3.21.0.4-1.x86_64.rpm
  

2. Activate and log in

expressvpn activate
expressvpn login
  

3. Choose protocol and connect

expressvpn protocol lightway_udp
expressvpn connect
  

4. Auto-start on boot

systemctl enable expressvpn.service
  

ProtonVPN

ProtonVPN’s CLI can be installed from their official RPM repository or via pip. It supports both OpenVPN and WireGuard. Below is the RPM approach.

1. Add the ProtonVPN repo and import key

yum install -y yum-utils
yum-config-manager --add-repo https://repo.protonvpn.com/fedora/protonvpn-fedora.repo
rpm --import https://repo.protonvpn.com/public_key.asc
  

2. Install and initialize

yum install -y protonvpn
protonvpn init
  

3. Connect using your preferred protocol

# For WireGuard:
protonvpn connect --fastest --protocol wireguard

# For OpenVPN:
protonvpn connect --fastest --protocol openvpn
  

4. Integrate with systemd for auto-reconnect

cat gt /etc/systemd/system/protonvpn.service ltltEOF
[Unit]
Description=ProtonVPN auto-connect
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/protonvpn connect --fastest
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable protonvpn.service
  

Each of these clients has been tested on CentOS 7, 8 and Stream, and integrates cleanly with systemd, SELinux and the RHEL-packaging model. Choose the one whose network protocols and geographic coverage best fit your requirements, and you’ll have secure, reliable connectivity in no time.

Download TXT



Leave a Reply

Your email address will not be published. Required fields are marked *