Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Set Up an OpenVPN Server on a VPS

A VPN on your VPS gives secure access to the server private network from outside. This guide uses the Ubuntu OpenVPN package as a minimal base.

Steps

  1. Install OpenVPN and easy-rsa:

    sudo apt update
    sudo apt install -y openvpn easy-rsa
  2. Enable IP forwarding:

    echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-openvpn.conf
    sudo sysctl --system
  3. Copy the sample PKI and build CA/server certs (tune names):

    make-cadir ~/openvpn-ca && cd ~/openvpn-ca
    ./easyrsa init-pki
    ./easyrsa build-ca nopass
    ./easyrsa build-server-full server nopass
    ./easyrsa gen-dh
  4. Copy certificates to /etc/openvpn/server, create a basic server.conf (port 1194/udp, proto udp, dev tun) and start the service:

    sudo systemctl enable --now openvpn-server@server
    sudo ufw allow 1194/udp

Tips

  • For production, issue clients with ./easyrsa build-client-full NAME nopass and a .ovpn profile.
  • Prefer restricting SSH and admin panels to the VPN when possible.

ext step

A stable VPS for your VPN: Deploy your Cloud VPS.

Related guides