«

»

Dec 30 2012

How to setup OpenVPN in a Debian 6 VPS

Sometimes, especially with all of the sales, you can gather quite a few extra VPS servers. Especially small ones that aren’t very good for large scale projects. This is why I decided to turn one of my low end VPS servers (that’s redundant, isn’t it…) into an openVPN server that I can use to securely access the Internet. This is especially helpful for on my Android phone when connecting to wireless hot spots. You never know who is looking at your traffic.

So let’s get started!

Open VPN is very powerful. It can be customized in many different ways and for the sake of this article we are going to set up a simple and easy to use version of OpenVPN called OpenVPN AS. This will allow you to create user account, limit bandwidth, configure tunneling, and all that good stuff right from a web browser without having to mess with confusing configuration files. The only downside to this is the python server for the web interface takes up a bit more memory than a vanilla, manual configured, OpenVPN server. But it is still completely worth it. I have tested this on a ~320MB OpenVZ VPS and it runs flawlessly. Just make sure your provider enable TUN/TAP for your container. That should only be necessary on OpenVZ. On the other hand, KVM server will allow you to proceed full steam ahead!
First off, I would recommend preforming a clean install of Debian 6 to your VPS through the providers web control panel. It’s not required but just in case there are some left over packages from your previous projects, it should clean up them up.

Now we are ready to grab the packages we need!

Use wget to grab a copy of openVPN.

For 32 bit: wget http://swupdate.openvpn.org/as/openvpn-as-1.8.4-Ubuntu10.i386.deb
For 64 bit: wget http://swupdate.openvpn.org/as/openvpn-as-1.8.4-Ubuntu10.amd_64.deb

Now let’s install this package!

For 32 bit: dpkg -iĀ openvpn-as-1.8.4-Ubuntu10.i386.deb

For 64 bit: dpkg -i openvpn-as-1.8.4-Ubuntu10.amd_64.deb

Set a password for OpenVPN by running the following:

passwd openvpn

Navigate to the web interface for OpenVPN by going to the following address in a web browser. Be sure to insert the IP address of your VPS.

https://IP-ADDRESS:943/admin

Log in using the username: openvpn and the password we set earlier.

That’s it! You are all set up! You can go ahead and add users or download the client for your computer. (You can download the client from https://IP-ADDRESS:943)
Questions? Run into any problems? Ask in the comments! We’re more than happy to help!

  • Not_without_incident

    I was very disappointed to find out that this only supports 2 concurrent connections, and when on a phone you will probably have one for phone-data and one for wifi. So my and my wife could not use it at the same time. Of course it works if both of us only use one connection though. But this “ugly fast setup” even though it was very simple and fast to setup, is severely limited. I will probably go for a opensource free unlimited version later on. But still thanks for this great tutorial šŸ™‚

  • joko sujoko

    how to add user for accessing the openvpn?

    • You can add a user from the admin interface for OpenVPN. There is a spot to enter a new username under “User Permissions”

  • Hadi Akmal

    Straightforward tutorial. It works thanks. šŸ™‚