Home Raspberry Pi The hassle free Raspberry Pi VPN - piVPN server

The hassle free Raspberry Pi VPN – piVPN server

Configuring an openVPN can be a difficult task. Not when you have piVPN to help you!

Setting up your own VPN server sounds complicated and time-consuming. It was at first, especially when you are trying to do this from China and half of the internet related to VPN is not available. Fortunately, with hassle-free Raspberry Pi VPN – piVPN you can get it up and running in a moment. The process is easy enough but I will walk you through to make sure you do it right. If you wonder what kind of performance you should expect from the Raspberry Pi Zero check this article out.

Hassle free Raspberry Pi VPN VPN – piVPN server on Raspberry Pi Zero

The process is very simple, as the installer as very easy to follow steps with little variations. Before you start, head to www.no-ip.com and get a DNS. It’s easier than remembering your IP. If you wonder if you should splash out on the best Raspberry Pi board, read this article about VPN speeds across the boards. You will need it for the installation. You will also need:

  • A way to download a file from Raspberry Pi to PC or phone (I use Notepad++ FTP plugin or WINscp )
  • Open VPN app/software on your client device
  • 15 min of spare time to wait for the key generation

Check the server’s IP, you can do so by visiting Google and typing my IP, or type:

dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}'

in the console of your Raspberry Pi.  You will also need access to your router, as we will have to forward a port.  Before you start with all of this make sure your Raspberry Pi has a static IP assigned. Run:


to check what interface handles your internet connection and follow the steps from here to make it permanent.

You are ready to roll. Update your Raspberry PI and run:

curl -L https://install.pivpn.io | bash

This is not the safest way to get things done on the Raspberry Pi, but you can trust this installer. To navigate the menus use arrows/TAB to change the cursor position, SPACE to select an option and ENTER to continue. If you don’t have a static IP I found a fairly simple guide from noip.com that shows you how to update your IP every X minutes. The link is here.

piVPN installation

Take the time reading the info, as going back is not always possible. I will assume you have completed the static IP part already so we could move on.

You should see the current IP address listed. Check if this is the same one you have configured previously and confirm. You can change it at this point as well. Note the Gateway address. We will use it later. Unless you have multiple users you should see only one option. Use arrows and SPACE to select the correct user.

Because it is a VPN server we want to make sure we don’t have to attend it. It’s for the best if you leave the piVPN to apply the settings automatically.

UDP vs TPC -extra security over speed – UDP, as suggested it the better option.

Use a different than the default, port number. Ie 1501 and make a note of this. Confirm the chosen port. Now key encryption. 2048-bit will take about 20 min,  and it’s the standard security. For your safety pick the 2048-bit encryption and go get a brew, or watch another video from my playlist.

Once the encryption is done, it’s time to fill in the DNS (or IP address) you can use the default one but I strongly recommend the DNS.

Time to provide the server with custom DNS – we are going to use our router’s IP: (The Gateway you have noted before).

The system is ready for the reboot. You will be able to add the users.

Use piVPN -h for help file and run

pivpn -a

to add a new user. You will be asked to add a password as well.

Everything is done on the server side. Time to download the openvpn config file to a client.

You can do this by using FTP client of the Notepad++:

Save it somewhere and open the openVPN client of your choice. For the PC open up the OpenVPN and import the profile, the same goes for the android app.  Once you have done this, you are ready to go. 

Your VPN should be up and running now. It may not protect your privacy while you are home, but will deal with IP related bans when you are visiting places. As you can see, creating your own Raspberry Pi VPN server is easy, and hassle-free!


Nothing says "Thank you" better than keeping my coffee jar topped up!


Support me on Patreon and get an early access to tutorial files and videos.


Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency


Add an SSD to Raspberry Pi 4 and turn it into a super-cooled NAS drive.

More HATs

Argon One

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO

More cases on

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Free wireless doorbell (Amazon Dash button hack)

The most terrifying situation I can imagine* is missing a parcel

Raspberry Pi NAS: (NAS-pi) Modding like a boss #part2

Plex and RAID1 NAS drive build log

MagPi – auto-downloader

Grab each edition of Mag Pi as soon as possible!


How to boot Raspberry Pi 4 from USB

How to set up and boot Raspberry Pi 4 from USB drive - headless guide.

Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or cables

Getting Raspberry Pi boards connected in seconds

Everything you need to start using JSON

It's JSON not Jason, just saying!

How to use Join App in NodeRED

The day finally comes where Join app is almost everywhere!

Driving LCD with Arduino and Raspberry Pi

Displaying things on an LCD screen is as easy as going through a cup of jellybeans while writing this tutorial!