OpenVPN server on Debian 9 with VestaCP

OpenVPN is free VPNsoftware that runs on your server.  We will use a free script that will install the VPN server on your server, then we will be able to connect to it through free Windows, Android, Apple and Linux apps. We willbe using Nyr’s free install script.

It is assumed that you have VestaCP Control Panel installed and SSH root access to your server.


First we must open the OpenVPN port in out firewall with VestaCP.


We will use VestaCP to open the port in our firewall OpenVPN uses,   port 1194.   Go to your VestaCP Control Panel and click the “Firewall” link at the top of the VestaCP Control Panel.

Click the round green “+”  ADD RULE button and fill in the firewall info like below.

Action = Accept
Protocol = UDP
Port = 1194
IP address =
Comment = OpenVPN

Click the green “Add” button.


Now we install OpenVPN


SSh to your server, su to root root and run the following command, this will download and run the script.

wget -O && bash

When the script initializes it will ask you five questions. I always accept the default options for the first 4 questions and change the client name to a easily remembered name for the fifth question. In this case I named it “ultimate”.

When the script finishes it will tell you that your new VPN client configuration file is available in the /root directory


Now go to your root folder /root

cd /root

Make sure your configuration file is there:

ls -l

copy the .ovpn file to your admin account

cp ultimate.ovpn /home/admin

Transfer your .ovpn file from your server to your local computer via SFTP or add it to your Nextcloud if you installed that from an earlier Ultimate Server Tutorial in this series.

Download and install a free OpenVPN client for your computer, phone or tablet, then import your .ovpn file into it.  This will provide a secure connection from your local PC, phone or tablet to your server.  I would not count on this to always hide your IP number. Sometimes it does and sometimes it doesn’t with Chrome and other browsers.