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

Openvpn Installation

On Debian/Ubuntu use:

# apt-get update && apt-get install openvpn

More details, refer to Official OpenVPN software repositories and Getting OpenVPN

Openvpn Setup

Server OS: Linux or Unix

Use one of the following setup scripts to configure openvpn.

  • Nyr/openvpn-install

    OpenVPN road warrior installer for Ubuntu, Debian, CentOS and Fedora.

    This script will let you set up your own VPN server in no more than a minute, even if you haven't used OpenVPN before.

    Steps to use:

    1. Download(On server):

      $ wget https://git.io/vpn -O openvpn-install-nyr.sh
      

      Or:

      $ curl https://git.io/vpn -L -o openvpn-install-nyr.sh
      
    2. Run(On Server, and need root user):

      # bash openvpn-install-nyr.sh
      

      Or merge step 1 and 2:

      # wget https://git.io/vpn -O openvpn-install-nyr.sh && bash openvpn-install-nyr.sh
      

      Or:

      # curl https://git.io/vpn -L -o openvpn-install-nyr.sh && bash openvpn-install-nyr.sh
      
    3. Copy the setup file to client(On client):

      $ rsync --progress -vz -e "ssh -p 222" user@server_ip:"/the_path_to_setup_file/user1.ovpn" .
      

      Or:

      $ scp -P 222 user@server_ip:"/the_path_to_setup_file/user1.ovpn" .
      
    4. Connect to server from client(On client, and need root user):

      # openvpn /the_path_to_setup_file/user1.ovpn
      
    5. Use your vpn connection to use remote network, e.g. use browser to access https://google.com

    After step 1 and step 2, you get the setup file for a user. If you want get another setup file for another user, repeat the two steps.

  • angristan/openvpn-install

    OpenVPN installer for Debian, Ubuntu, Fedora, CentOS and Arch Linux.

    This script will let you setup your own secure VPN server in just a few seconds.

    Steps to use:

    1. Download(On server):

      $ wget https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh -O openvpn-install-angristan.sh
      

      Or:

      $ curl https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh -o openvpn-install-angristan.sh
      
    2. Run(On Server, and need root user):

      # bash openvpn-install-angristan.sh
      

      Or merge step 1 and 2:

      # wget https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh -O openvpn-install-angristan.sh && bash openvpn-install-angristan.sh
      

      Or:

      # curl https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh -o openvpn-install-angristan.sh && bash openvpn-install-angristan.sh
      
    3. Copy the setup file to client(On client):

      $ rsync --progress -vz -e "ssh -p 222" user@server_ip:"/the_path_to_setup_file/user1.ovpn" .
      

      Or:

      $ scp -P 222 user@server_ip:"/the_path_to_setup_file/user1.ovpn" .
      
    4. Connect to server from client(On client, and need root user):

      # openvpn /the_path_to_setup_file/user1.ovpn
      
    5. Use your vpn connection to use remote network, e.g. use browser to access https://google.com

    After step 1 and step 2, you get the setup file for a user. If you want get another setup file for another user, repeat the two steps.