Setting up an OpenVPN connection on Raspberry Pi.

The following instructions go step by step through the creation process of an OpenVPN connection on Raspberry Pi using Wheezy Raspbian O/S. The If you have any problems with this connection type we strongly recommend using a DD-WRT connection or Smart DNS.

We will assume that each command are entered as the user 'root'. If you don't have password for root, you can do this with your current user, but prepending each command with 'sudo', e.g: sudo /etc/init.d/openvpn restart

1. First you need to update the current list of packages:

apt-get update

2. You need to install the openvpn daemon:

apt-get install openvpn

3. You now need a copy of our tcp/udp configs, which you can get from our control panel or click here downoload them directly from our server. You should copy them to the pi (via scp, for example), and unzip them into /etc/openvpn.

cd /etc/openvpn
unzip /home/pi/

4. Choose whichever type of connection you will use - tcp or udp. Copy the necessary files from config subdir into /etc/openvpn:

cp config/* .
rm tcp.ovpn
mv udp.ovpn vpnuk.conf

5. Edit the config and change the name of the server. You can change the port, too, if needed, to one of the ports we support (1194, 55194 or 65194 for UDP or 443, 80 or 8008 for TCP).

6. After the auth-user-pass, enter a filename, e.g. 'user.txt'.
Save the config, and exit to the shell.

7. Create a file with your username and password in it on two different rows, e.g.:

root@raspberrypi:/etc/openvpn# cat user.txt

8. Protect the file:

chmod go-rwx user.txt

9. Restart openvpn:


10. Thats It! You should be up and running.

Comments (2)

Full StarFull StarFull StarFull StarFull Star
RICHARD WILKINSON (United States) says...
thanks for posting this. i've only had my rpi3 for a couple of days and as an expat wanted to watch the beeb! Took a few attempts but now I can connect. The video quality is decent, but I have no sound, when the video starts there are a couple of seconds of garbled audio and then no sound at all.
Any ideas?
Hello Richard, that could be down to something as simple as the wrong sound mode being enabled.

Take a look at this:

I hope it helps.
2nd April 2016 10:46pm
Full StarFull StarFull StarFull StarFull Star
James Saunders (United Kingdom) says...
Works perfect! If you get the following syslog messages:

Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)
Mar 20 23:03:33 SLD-TS01 ovpn-vpnuk[19532]: Linux ifconfig failed: external program exited with error status: 255

You need to update the Pi's firmware using "sudo rpi-update" then reload the device "shutdown -r now" this will resolve the issue if your firmware was a bit out dated like mine.

Works on release:

PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION="7 (wheezy)"

You should then see the Tunnel up using "ifconfig" and prove your external IP using "wget -qO -"

21st March 2016 12:13am
Page 1 of 1

Add Comment

* Required information
(will not be published)
Enter the third letter from the word vpnuk
Enter answer:

Contacts & Social
Correspondence Address:
VPNUK Limited
Office B0245
265-269 Kingston Road
SW19 3NW
United Kingdom

Telephone Contacts
INUM: +883 510 001 193 452
UK: +44 203 608 6599
USA: +1 702 9240633
Spain: +34 902 848 027

Social Media
Join the discussions with VPNUk on Twitter Follow us on Facebook Follow us on Google Plus Watch out setup tutorials on the VPNUK You Tube channel Connect with VPNUK on Linkedin Connect with VPNUK on instagram

UK - USA - Switzerland
Germany - Spain
Australia - Canada
Netherlands - France
Italy - Hong Kong
Denmark - Ireland
Sweden - Russia
Luxembourg - Poland
Singapore - Iceland
Panama - Egypt
Israel - India - Japan


Sign up to our newsletter and we will keep you up to date with all the latest news, reviews and service updates.

Static VPN IP Accounts
Dynamic VPN IP Accounts
Online TV Film & Sport
SmartDNS Services
Live TV Service
Online Security
Geo Location
Personal Firewall

Copyright © VPNUK Limited 2017 | Registered in Belize Company No 144643