OpenVPN Server, OSMC, Raspberry Pi, Raspian

OpenVPN Server on OSMC Pi (or Raspian)

This is the first of a series of posts on how I set up a Raspberry Pi 2 Model B running OSMC to operate as an OpenVPN server.

I found a number of tutorials on setting up OpenVPN on the Pi running Raspian but there are some subtle differences if you are using OSMC.

Update: This tutorial also works with Raspian installed as your PI operating system. I currently have a PI running as a web cam (MotionEye) and OpenVPN server which I set up using these instructions (there’s a couple of places where a path may be different so I will update this tutorial at some point to identify the differences but they should be fairly obvious to most).

Setting up your Pi as an OpenVPN server allows you to securely connect to your home network with your phone/tablet/laptop when you are out and about. This means you can access the internet from your device as if you were at home i.e. with the same level of security and the same location (useful if you are abroad so you can access content which may be restricted to your home country).

This is NOT about setting up your Pi as a VPN client connecting to an external VPN server provider.

To run an VPN server you need a static public IP address. If you don’t already have one (as I didn’t) then you need to set up a Dynamic DNS domain name. I created a free Dynamic DNS domain on

The following instructions are specific to my environment and the choices I made e.g using It’s not a definitive, fits-all tutorial, just an explanation of the way I did it.

Note, this is not a quick process; it will probably take you 2-3 hours if all goes smoothly … one operation in step 3 alone can take up to 1 hour to complete (you don’t have to watch it complete so plan for a break).

Be patient. The key is to type the commands accurately; be careful to get the spaces right. Don’t be tempted to cut and paste commands from the web page into the terminal window as some characters may not be as they appear. Step 3 is the longest and most error prone stage; it may help to print the page so you can tick off commands as you proceed and make notes (I found it a help when doing my initial set up with the tutorial I used). Good luck!

Step 1: Preparation

Step 2: Set up a free Dynamic DNS domain on

Step 3: Set up OpenVPN Server

Step 4: Set up a device to use OpenVPN Server


Make a backup of your installation

Supporting Posts

Create a script to automatically start OpenVPN after a reboot

Set up port fowarding on a BT Home Hub 5 router

Set a device to have a static internal IP address on BT Home Hub 5 router

My Sources:


If you have found this useful then I’m glad to be of help. If you have found it REALLY useful you can send me 1 US Dollar by clicking the Donate button!

Donate Button


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s