How to installOpenVPN-AS on Debian or Ubuntu using Digital Ocean

How to installOpenVPN-AS on Debian or Ubuntu using Digital Ocean

From a while, I used OpenVPN-AS on Digital Ocean because is cheap to pay for a VPS and install different services.

One of the benefits of installing OpenVPN-AS is that it include a web client, the limitation is that the free license is only for 2 users.

Installation

The package is on the official OpenVPN website and is available for some linux distributions, the first thing that we have to do is access to the server via ssh and download the package, for this example I will use Debian:

wget http://swupdate.openvpn.org/as/openvpn-as-2.1.4-Debian8.amd_64.deb

The command below is to install the package:

sudo dpkg -i openvpn-as-2.1.4-Debian8.amd_64.deb

After the installation it will show you something similar to this:

![alt](/content/images/2017/04/openvpn-as-intallation-finished.png)

The next step is to change the password to the openvpn user:

sudo passwd openvpn

After the installation appears the web client URL, you can check if everything is working from the web interface and also you can download the desktop clients.

The web client URL:

![OpenVPN AS Web Interface](/content/images/2017/04/openvpn-as-webclient.jpg)

Problems

Binding the wrong interface (connection refused).

If the connection is refused with you are trying to enter into the web client for the first time the problem could be OpenVPN-AS is binding the wrong interface, to fix it is simple, you only need reconfigure manually with this command:

/usr/local/openvpn_as/bin/ovpn-init tool.

And when it prompt for the interface, choose all the interfaces:

![OpenVPN AS interfaces](/content/images/2017/04/openvpn-as-interface.png)

TUN/TAP error after upgrade the kernel.

The error in the message below appears when the service starts and after you upgrade the kernel:

process started and then immediately exited: ['Mon Dec 1 16:58:24 2014 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)']

service failed to start or returned error status process started and then immediately exited: ['Mon Dec 1 16:58:24 2014 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)'] service failed to start or returned error status

Solution:

  1. You need to go to the Digital Ocean control panel.
  2. Enter to the Dropplet where you installed OpenVPN-AS.
  3. Click on the Setting tabs and click on the kernel.
  4. Change the kernel to the last version.
  5. Turn off the server poweroff, because restart won't work.
  6. Enter to the Dropplet and check that the message doesn't appear anymore.