How to Set Up OpenVPN on OpenElec / KODI

How to Set Up OpenVPN on OpenElec / KODI

Please note that there is no option in OpenELEC and/or KODI to change the OpenVPN port. The default port is 1194 and this should work fine for most people.
Step 1: Download the required files
To configure OpenVPN on OpenELEC/KODI you need to modify a .ovpn file and use SFTP and SSH.
First download our TLS key and VPN certificate (CA):
Choose a OpenVPN configuration on our servers page ( or download our default configuration.
Step 2: Create a authentication file
Create a new text file pass.txt on your dekstop and insert your VPN Username and VPN password. Username in first line and password in second line.
Step 3: Modify the OpenVPN configuration
Open the .ovpn file you downloaded in step 1 and modify the following:
1. Find the lines that say <tls-auth> and </tls-auth>. Remove everything that's in and between these lines so that the complete block is gone.
2. Now add tls-auth /storage/.config/vpnht-tls.key 1 on a new line.
3. Find the line that says auth-user-pass and change it to auth-user-pass /storage/.config/pass.txt
3. Find the lines that say <ca> and </ca>. Remove everything that's in and between these lines so that the complete block is gone.
4. Now add ca /storage/.config/vpnht.crt on a new line.
Step 4: Transfer the files
Start your favourite SFTP client (WinSCP on Windows for example) and transfer the .ovpn files, vpnht.crt, vpnht-tls.key and pass.txt to /storage/.config/ on the OpenELEC/Kodi device.
The default user is 'root' and the default password is 'openelec'.
Step 5: Connect
Now start your favourite SSH client (terminal on Unix, Putty on Windows) and run the following command:
openvpn /storage/.config/your-OpenVPN-filename.ovpn
Wait a few seconds and you should be connected!
You can check your connection by executing:
Step 6 (Optional): Start at boot
Make sure you're still connected using your favourite SSH client. And execute the following command:
touch /storage/.config/ && chmod +x /storage/.config/
Then start nano (or your favourite command line text editor):
nano /storage/.config/
Now make sure the file contains the following (write and save it) and the VPN will connect at startup:

sleep 10s
openvpn /storage/.config/your-OpenVPN-filename.ovpn &
  • 31 Users Found This Useful
Was this answer helpful?

Related Articles

How do you setup the ASUS wireless router vpn ?

How do you setup the ASUS wireless router vpn ? Some ASUS routers support connecting to a VPN...

Setup L2TP VPN in Windows

Setup L2TP VPN in Windows 1. Start Remote Access Phonebook (RASPHONE) Start the Run command...

Linux Ubuntu Network Manger OpenVPN

Ubuntu (OpenVPN) This guide is also available as video tutorial: click here to proceed to the...

DD-WRT Openvpn at startup

DD-WRT (OpenVPN at Startup) Note: OpenVPN only works on Big, Mega and some Std versions of the...

Setup VPN Client on Synology

Setup VPN Client on Synology  Step 0: Go to your DSM control panel If you do not know the...