OSMC (Open Source Media Center) is a free and open-source media player software that allows users to turn their Raspberry Pi into a full-featured media center. OSMC is specifically designed for Raspberry Pi devices and offers a user-friendly interface with easy installation and setup.
While OSMC provides a great media center experience, users may encounter geo-restrictions when trying to access certain content due to their geographic location. This is where a VPN (Virtual Private Network) comes in handy.
By using a VPN on OSMC, users can mask their IP address and location, bypassing geo-restrictions and accessing content that may be otherwise unavailable. Learn how you can set it up in our guide below.
How to setup PPTP VPN on OSMC

Just follow these steps to configure a PPTP connection for OSMC:
- Open Terminal on your Raspberry Pi.
- To install the PPTP packages, enter the following:
sudo bash
sudo apt-get install pptp-linux
- Run the following command to create a PureVPN profile:
sudo nano /etc/ppp/peers/purevpn
- Once done, enter the following information:
pty “pptp ukl1.pointtoserver.com –nolaunchpppd –debug”
name [type your PureVPN username]
password [type your PureVPN password]
remotename PPTP
require-mppe-128
require-mschap-v2
refuse-eap
refuse-pap
refuse-chap
refuse-mschap
noauth
debug
persist
maxfail 0
defaultroute
replacedefaultroute
usepeerdns
- Save the changes and exit the text editor.
- Run the following command to connect to PureVPN:
sudo pon purevpn
- You are now connected. Use PureVPN PPTP on OSMC hassle-free!
How to setup OpenVPN on OSMC
Just follow these steps to configure a OpenVPN connection for OSMC:
Step #1: Install a DNS forwarder
A DNS forwarder is a server that forwards DNS queries to other servers on the internet. By setting up a DNS forwarder on your Raspberry Pi, you can specify which DNS servers to use for your OpenVPN connection and/or set up split tunneling.
- Open Terminal on your Raspberry Pi.
- Update the package list using the following command:
sudo apt-get update
- Now, run the following command to install dnsmasq:
sudo apt-get install dnsmasq
- Once the installation is complete, configure dnsmasq by editing the configuration file using the following command:
sudo nano /etc/dnsmasq.conf
- Use the arrow keys to navigate to the lines containing “domain-needed” and “bogus-priv”.
- Remove the “#” symbol at the beginning of the lines to uncomment them. It should look something like this:
domain-needed
bogus-priv
- Change the interface name to “eth0”. It should look something like this:
interface eth0
- Save the changes and exit the text editor.
- Restart the dnsmasq service to apply the changes. For example:
sudo systemctl restart dnsmasq.service
Step #2: Configure OpenVPN on Raspberry Pi
Just follow these instructions:
- Download the PureVPN OpenVPN configuration files from here and extract them.
- Rename the folder to “OPVNfiles” and click the Ok button.
- Open the Terminal application.
- To install the OpenVPN packages, run the following command:
sudo bash
sudo apt-get install openvpn
- Copy the downloaded OVPNfiles to the /etc/openvpn directory by running the following commands:
cd Downloads/
sudo cp -r OVPNfiles/* /etc/openvpn
- Navigate to the /etc/openvpn directory by running the following command:
cd /etc/openvpn/
- Connect to the PureVPN server by running the following command, replacing “de2-ovpn-tcp.pointtoserver.com” with the desired server:
sudo openvpn de2-ovpn-tcp.pointtoserver.com
- Enter your PureVPN credentials when prompted to do so.
- You are now connected to PureVPN. The second last line in the Terminal will display your current VPN IP address.
Step #3: Setup logrotate
Logrotate is a Linux utility that rotates and archives log files to prevent them from using up too much disk space.
- Open the Terminal on Raspberry Pi.
- Type the following command and then hit Enter:
sudo nano /etc/logrotate.conf
- This will open up the logrotate configuration file in the nano text editor.
- Scroll down to the line that reads “# rotate log files daily” and remove the comment symbol “#” at the beginning of the line.
- Then, change the line to read “rotate daily” to set the rotation frequency to daily.
- Next, find the line that reads “# keep 4 weeks worth of backlogs” and remove the comment symbol “#”at the beginning of the line.
- Change the line to read “rotate 4” to set the number of backlogs to 4.
- Save the changes by pressing Ctrl+O, then Enter, and exit nano by pressing Ctrl+X.
Step #4: Configure IPTables
Configuring IPTables for Raspbian firewall is important for a VPN on Raspberry Pi because it allows for additional security by filtering incoming and outgoing traffic based on defined rules.
- Open the Terminal and type the following command to install the IPTables firewall:
sudo apt-get install iptables
- Once installed, create a new shell script file to configure the firewall rules using the following command:
sudo nano /etc/firewall.sh
- Add the following rules to the firewall script file to allow SSH, HTTP, and HTTPS traffic:
#!/bin/sh
iptables -F
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack –ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp –dport 22 -j ACCEPT
iptables -A INPUT -p tcp –dport 80 -j ACCEPT
iptables -A INPUT -p tcp –dport 443 -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables-save > /etc/iptables.rules
- Save the file and exit by pressing Ctrl + X, followed by Y, and then Enter.
- Make the script executable by running the following command:
sudo chmod +x /etc/firewall.sh
- To start the firewall and apply the rules, run the following command:
sudo /etc/firewall.sh
- To make the firewall rules persist after reboot, add the following line to the end of the /etc/rc.local file:
/sbin/iptables-restore < /etc/iptables.rules
- Save the file and exit by pressing Ctrl + X, followed by Y, and then Enter.
Your Raspbian firewall is now configured with the IPTables rules to allow SSH, HTTP, and HTTPS traffic.
Step #5: Disable IPv6 and enable port forwarding
IPv6 is not commonly used by most internet service providers, and some VPN providers may not support it. Therefore, it is recommended to disable IPv6 in the VPN configuration to prevent any potential security issues or leaks.
- Open the terminal on Raspberry Pi and type the following command to edit the “sysctl” configuration file:
sudo nano /etc/sysctl.conf
- Add the following lines at the end of the file to disable IPv6:
# disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
- Save the file and exit by pressing Ctrl+X, then Y, and then Enter.
- Type the following command to apply the changes made in the “sysctl” configuration file:
sudo sysctl -p
- Next, edit the IPTables configuration file by typing the following command:
sudo nano /etc/sysctl.conf
- Uncomment the line net.ipv4.ip_forward=1 to enable port forwarding:
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
- Save the file and exit by pressing Ctrl+X, then Y, and then Enter.
- Type the following command to apply the changes made in the IPTables configuration file:
sudo iptables-apply
- Restart your Raspberry Pi to apply all the changes.
Your Raspberry Pi can now use a VPN with IPv6 disabled and port forwarding enabled.
How to install KODI 17 through OSMC on Raspberry Pi
You can install KODI 17 on Raspberry Pi through OSMC by following these steps:
- First, make sure your Raspberry Pi is connected to the internet.
- Next, launch the OSMC app on your Raspberry Pi.
- From the OSMC home screen, go to the Settings option.
- In the settings menu, select System Settings and then Add-ons.
- Select Install from Repository, then choose Kodi Add-on Repository.
- In the Kodi Add-on Repository, find and select “Kodi Version 17 (Krypton)“.
- Press the Install button to download and install KODI 17.
- After the installation is complete, you can launch KODI 17 from the OSMC home screen.
Note: You can also install KODI 17 through the command line interface by running the following commands:
sudo apt-get update
sudo apt-get install -y kodi=2:17.6-1~stretch
This will install KODI 17 on your Raspberry Pi running OSMC.
How to install Zomboided VPN Manager
Zomboided VPN Manager for OpenVPN is a plugin for OpenVPN on OSMC that simplifies the setup and management of VPN connections.
- Connect to your Raspberry Pi with SSH as OSMC user:
ssh osmc@<IP ADDRESS>
- Download the latest Zomboided repository using the following command:
wget https://github.com/Zomboided/repository.zomboided.plugins/releases/download/1.0.0/repository.zomboided.plugoins-1.0.0.zip
- Go to the OSMC home screen and select Settings, then Add-on browser, and then Install from Zip.
- Choose the repository.zip file to install:
Home folder>repository.zomboided.plugins-x.x.x.zip
- After installing the repository, go to the repository’s menu:
Install from repository>Zomboided Add-on repository>Services
- Install the add-on by selecting “VPN Manager for OpenVPN”.
To install Zomboided VPN Manager via the add-on:
- Connect to your Raspberry Pi via SSH as the OSMC user.
- Download the latest release of the add-on using the following command:
wget https://github.com/Zomboided/service.vpn.manager/releases/download/6.0.2/service.vpn.manager-6.0.2.zip
.
- From the OSMC home screen, select Settings, then Add-on browser, and then Install from zip.
- Select the add-on.zip file to set up:
Home folder>service.vpn.manager-x.x.x.zip
How to add channels on OSMC
To add channels on OSMC, follow these steps to add a media source:
- From the home screen of OSMC, click Settings and then File Manager.
- Click Add Source.
- Enter the path or browse to the media location, and enter https://kodi.metalkettle.co in the box.
- Enter any name for the specified media source.
- Go back to the home screen and click Settings.
- Go to Add-ons and choose Install from zip file.
- From the list of zip files, select “MK REPO.”
- Select Recommended Repositories and choose “lambada-1.1.0.zip” to install.
- After installing the zip file, you will be notified with an Add-on enabled notification.
- Click Get Add-ons and select lambda Add-on repository.
- Click Video Add-ons and install Genesis.
- Go back to the home screen and click Videos and then Video Add-ons.
- Find Genesis and proceed by clicking on it.
You can set up endless channels on OSMC by following the above mentioned steps. Ensure that you are using a VPN on OSMC to evade any geo-restrictions you might come across.