gitmyhub

openvpn-install

Shell ★ 16k updated 2d ago

Set up your own OpenVPN server on Debian, Ubuntu, Fedora, CentOS, Arch Linux and more

A shell script that sets up a fully configured OpenVPN server on your Linux machine in seconds, handling certificates, firewall rules, and client config generation automatically.

ShellOpenVPNsystemdiptablesnftablessetup: moderatecomplexity 3/5

This project is a shell script that sets up an OpenVPN server on a Linux machine. OpenVPN is software that lets you build your own VPN, a private encrypted tunnel between your devices and a server you control, so a phone or laptop can route its internet traffic through that server instead of directly through the local network. The script takes the fiddly setup work — generating certificates, configuring the server, opening the firewall — and turns it into something you can do in just a few seconds.

You run the script on a server you own, whether that is a rented VPS, a dedicated box, or a computer at home. After installation you generate a client configuration file (an .ovpn file) for each device, copy it across, and connect with any OpenVPN client. The README also documents a non-interactive CLI for automation: subcommands like install, uninstall, client add, client list, client revoke, client renew, and server renew, with JSON output for scripting. Revoking a client disconnects it immediately.

The script supports a wide range of Linux distributions including AlmaLinux, Amazon Linux 2023, Arch Linux, CentOS Stream, Debian, Fedora, openSUSE, Oracle Linux, Rocky Linux, and Ubuntu, and it requires systemd. It manages firewall rules through firewalld, nftables, or iptables, supports IPv4 and IPv6 in any combination, lets you pick TCP or UDP, and offers configurable VPN subnets, MTU, DNS resolvers, and encryption settings. People reach for it when they want their own VPN for privacy, getting around blocked networks, or remote access to home services, without learning the whole OpenVPN configuration surface by hand. The full README is longer than what was provided.

Where it fits