How to Install OpenVPN on Raspberry Pi

Home » Guides » How to Install OpenVPN on Raspberry Pi
Guides, How to 2 Comments
No votes yet.
Please wait...

raspberry-pi-logo-720x340

Inspired by the 1981 BBC Micro, Raspberry Pi is a very small computer, about the size of a credit card, that was created originally by Eben Upton to enhance and develop programming skills for pre-university level students at an affordable rate. The Pi was launched on February 19, 2012 and as a small open hardware, the Raspberry Pi became very popular among tech-savvy enthusiasts for its ability to support Arduino devices and other basic microcontrollers. The device was developed and designed mainly to run Linux OS and many of its distributions. However, there are two new customised operating systems for Raspberry Pi devices, the Raspbian (based on Debian) and Pidora (based on Fedora). Pi is used by many across the globe in a wide range of tasks, mainly in projects on a device that uses small space. The Pi can help young adults learn how to code. It can be used as a PC and can also be used to make gaming consoles.

In this tutorial, we will show you how you can install OpenVPN on a Raspberry Pi device. Scroll down for more details.

Configuring OpenVPN on Raspberry Pi

Follow the steps below in order to setup OpenVPN on Raspbian.

1- Update your Raspberry Pi, and then restart it using the following command:

sudo rpi-update && sudo reboot

2- Download and install OpenVPN using the following command:

sudo apt-get install openvpn unzip

3- Check to make sure that the time zone is correct. You can do that by running the following command, and then choose the correct time zone:

sudo dpkg-reconfigure tzdata

4- Now, download the configuration files you prefer to use with your VPN.

5- Run the following command to insert your login details:

echo  "username"  >> /etc/openvpn/credentials
echo "CHANGE TO YOUR PASSWORD" >> /etc/openvpn/credentials

6- Run the following command to check if your OpenVPN connection works properly:

sudo openvpn --config /etc/openvpn/bvpn.conf --daemon

7- Wait for at least 1 minute, and then run the following command to confirm that the connection successfully works:

curl https://www.bvpn.com/v1/api/client/ptr | python -m json.tool

8- You should then receive the following response:

{
    "ip": "46.227.67.132",
    "ptr": "cliXXX.ovpn.com",
    "status": true
}

9- Et voila! You have successfully setup OpenVPN on Raspberry Pi.

2 thoughts on “How to Install OpenVPN on Raspberry Pi”

  • Ron says:

    I´m very new on this so please bare with me. In 4- Now, download the configuration files you prefer to use with your VPN. ????
    What does that mean? Download them from where? I can´t seem to find them on the Net, and if they are, I don´t know what I´m looking for?

    Not sure if step 4 is the cause, but when I try Step 5 I get: ~ $ echo “username” >> /etc/openvpn/credentials
    bash: /etc/openvpn/credentials: Permission denied
    pi@raspberrypi:~ $ echo ¨username¨ >> /etc/openvpn/credentials
    bash: /etc/openvpn/credentials: Permission denied

    Appreciate any help you can provide. I really need this VPN to work. Thanks

    No votes yet.
    Please wait...
  • Tom says:

    he has copied another blog description and this nob has no idea what the right command are under raspberry…

    No votes yet.
    Please wait...

Leave a Reply to Ron Cancel reply