{"id":79271,"date":"2023-08-22T23:50:40","date_gmt":"2023-08-23T03:50:40","guid":{"rendered":"https:\/\/www.engineersgarage.com\/?p=79271"},"modified":"2024-01-09T21:19:14","modified_gmt":"2024-01-10T02:19:14","slug":"raspberry-pi-openvpn-vpn-server","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/","title":{"rendered":"How to build a Raspberry Pi VPN server"},"content":{"rendered":"<p><span data-preserver-spaces=\"true\">Cyber security is a growing concern. As homes and offices are more connected than ever, the risk of cyber attacks, identity theft, and hacking has increased significantly.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">A network has several smart devices connected to one another and the internet. In the case of a cyber-attack, each connected device is at risk. One effective way to protect a home or office network is to use a virtual private network or VPN.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">A VPN hides your IP address by redirecting the network through a remote server run by a VPN host. This private network essentially disguises one\u2019s online identity and encrypts the internet traffic coming to that network. It does this so well that even an internet service provider (ISP) or any third party cannot decipher which websites you visit or data you download or upload online.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">A virtual private network is ideal for protecting one\u2019s identity, securing data transfers, encrypting online data, and letting users access geographically restricted web content.\u00a0 \u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">There are many different types of VPNs, but these three are the most common:<\/span><\/p>\n<ul>\n<li><strong><span data-preserver-spaces=\"true\">SSL VPN \u2013<\/span><\/strong><span data-preserver-spaces=\"true\"> implemented through any HTML-5 browser and available for nearly all operating systems. This type of VPN is accessed through authentication on the browser with the help of a username and password.<\/span><\/li>\n<\/ul>\n<ul>\n<li><span data-preserver-spaces=\"true\">\u00a0<\/span><strong style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\"><span data-preserver-spaces=\"true\">Site-to-Site VPN \u2013\u00a0<\/span><\/strong><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\" data-preserver-spaces=\"true\"> ensures secure and encrypted communication between two separate networks (or intranets) from the same company. It operates between two LAN\/WAN networks within the same premise.\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li><strong><span data-preserver-spaces=\"true\">Client-to-Server VPN \u2013<\/span><\/strong><span data-preserver-spaces=\"true\">\u00a0implemented through a VPN client installed and configured on a computer. This is the most common and efficient VPN. It connects you to the internet directly via the VPN host instead of an internet service provider.\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-preserver-spaces=\"true\">VPN client servers can be installed and configured on microcomputers like Raspberry Pi (RPi). RPi serves as a gateway to the internet while securing and encrypting all smart-device access.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In this article, we\u2019ll install and configure OpenVPN, a VPN client, on Raspberry Pi. RPi can operate 24\/7 without consuming much power, making it a cost-effective option. Once the VPN is configured, you\u2019ll have access to your smart devices wherever you are, at home or away.\u00a0 \u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Components required\u00a0\u00a0<\/span><\/strong><\/p>\n<p><span data-preserver-spaces=\"true\"><strong>1.<\/strong> Raspberry Pi<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>2.<\/strong> MicroSD card<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>3.<\/strong> Keyboard and mouse (for installation and configuration only)<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>4.<\/strong> Display monitor and HDMI cable (for installation and configuration only)<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>5.<\/strong> Ethernet cable or WiFi\u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Prerequisite<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">Before starting, the Raspbian operating system must be installed on Raspberry Pi. The VPN client is a software application that runs over the operating system. Any Debian Linux derivative can run on RPI as an operating system. Raspbian is the official OS for the microcomputer and the one easiest to install and work with. It requires no manual configuration of features such as the keyboard layout, region, and language.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Remember, once you set up a VPN on Raspberry Pi for your home or office network, all of your computers and smart devices will be connected to one another. So, make sure they\u2019re all secure before continuing.\u00a0 \u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">VPN server\u2019s IP<br \/>\n<\/span><\/strong><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\">An IP address for the VPN is necessary, which can be a static or dynamic IP address. Setting up the VPN for a static IP address is straightforward, whereas a dynamic IP requires a domain name service (DNS). The domain name could be your own or a free one (check out no-ip.org at no cost).\u00a0\u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Port forwarding on RPi<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">After getting an IP address for the VPN, port forwarding the OpenVPN application is the next step application. The default port for OpenVPN is 1194. The protocol used by this port is UDP.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Here are the steps:\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\"><strong>1.<\/strong> On a computer connected to your home\/office network, open the router admin page on a web browser. The router IP is 192.168.1.1 or 192.168.1.254.<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>2.<\/strong> On the router admin page, enter the username and password. Typically, this is set to admin and admin, respectively.<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>3.<\/strong> After logging into the router admin page, navigate to forwarding -&gt; virtual server.<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>4.<\/strong> On this page, there are options for service port, IP address, internal port, protocol, and status. These settings will route internet traffic from the specified port to the port on Raspberry Pi.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Note:<\/span><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">The service port is the external port<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">The IP address is the IP address of the Raspberry Pi<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">The internal port must be set to Raspberry Pi\u2019s application port<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">The protocol is the internet protocol used by the application port, which must be set to ALL unless specified<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">The status must be set to enabled<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">For OpenVPN, set the internal port to 1194 and the protocol to UDP.\u00a0 \u00a0 \u00a0<\/span><\/li>\n<\/ul>\n<p><strong><span data-preserver-spaces=\"true\">Installing the VPN server<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">Setting up a VPN server on Raspberry Pi involves several steps. For example, there\u2019s installing the VPN application, generating the encryption keys, adding a port to the firewall, setting a static IP for RPi, and others.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">All of this gets complicated. An easier method is to use a script for the installation. Fortunately, the PiVPN script is available for Raspberry Pi models, simplifying the processes and reducing the chance of errors.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Let\u2019s start by changing Raspberry Pi\u2019s password. After setting up a VPN server on RPi anybody can access the microcomputer through the VPN, so changing the default password is important.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To do so, open the Terminal and execute the following command.<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>passwd<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79272 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-01.png\" alt=\"\" width=\"653\" height=\"446\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-01.png 653w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-01-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-01-348x238.png 348w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/a><\/p>\n<p>After changing RPi\u2019s default password, download the PiVPN script from GitHub by running the below command in the Terminal.<\/p>\n<p><span style=\"color: #800000;\"><strong>curl -L https:\/\/install.pivpn.io | bash<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79274 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-02.png\" alt=\"\" width=\"654\" height=\"441\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-02.png 654w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-02-300x202.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-02-353x238.png 353w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/a><\/p>\n<p>After downloading the script, you&#8217;ll be prompted by the following screen.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79279 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-03.png\" alt=\"\" width=\"654\" height=\"442\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-03.png 654w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-03-300x203.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-03-352x238.png 352w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/a>Press &#8216;Enter&#8217; to start installing the script.<\/p>\n<p>The next screen will explain that you must set up a static IP for your VPN to function properly. When Raspberry Pi is re-started, it will try and use the same IP address. If the IP address is changed, access to the VPN will be lost. Press &#8216;Enter&#8217; to continue.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-04.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79275 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-04.png\" alt=\"\" width=\"653\" height=\"449\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-04.png 653w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-04-300x206.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-04-346x238.png 346w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/a><\/p>\n<p>Next, you&#8217;ll be asked if you&#8217;re using a DHCP reservation on your router. If you&#8217;re uncertain, select &#8216;No&#8217; to continue. Also select &#8216;No&#8217; if\u00a0you do <em>not<\/em> want to set the displayed address as the IP for your VPN.<\/p>\n<p>However, to set your current IP address and gateway as static, select &#8216;Yes.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79276 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-05.png\" alt=\"\" width=\"654\" height=\"446\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-05.png 654w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-05-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-05-349x238.png 349w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/a><\/p>\n<p>If you selected &#8216;No,&#8217; a screen will appear warning you that your router may assign the IP address to another device. Most routers can sort out this on their own. Select &#8216;Ok&#8217; and press &#8216;Enter&#8217; to continue.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79277 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-06.png\" alt=\"\" width=\"695\" height=\"392\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-06.png 695w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-06-300x169.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-06-368x208.png 368w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/a><\/p>\n<p>The next screen will prompt you to set a user that will own the OpenVPN configuration file. Select &#8216;Ok&#8217; and press &#8216;Enter&#8217; to continue.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79278 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-07.png\" alt=\"\" width=\"654\" height=\"447\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-07.png 654w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-07-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-07-348x238.png 348w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/a><\/p>\n<p>The following screen will present a list of users &#8212; of which one can be selected to own the OpenVPN configuration file. (If there are more than one Raspberry Pi users, the full list of users will be displayed. If there&#8217;s only one default user, it will be displayed alone.)<\/p>\n<p>The list can be navigated by using the arrow buttons. Choose the correct user by pressing the space bar. Once you have selected a user, press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-08.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79280 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-08.png\" alt=\"\" width=\"655\" height=\"444\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-08.png 655w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-08-300x203.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-08-351x238.png 351w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/a>You&#8217;ll be asked what type of VPN you want to install on Raspberry Pi. There are two choices available: WireGuard and OpenVPN. Use the arrow keys to navigate to OpenVPN and select it by pressing the space bar. Then, press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-09.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79281 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-09.png\" alt=\"\" width=\"697\" height=\"375\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-09.png 697w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-09-300x161.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-09-368x198.png 368w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/a><\/p>\n<p>Next, you&#8217;ll be asked if you want to customize the settings for OpenVPN. The settings chosen by the PiVPN script are ideal for most users and need not be changed unless required. Select &#8216;No&#8217; and press &#8216;Enter&#8217; to continue.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79282 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-10.png\" alt=\"\" width=\"649\" height=\"441\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-10.png 649w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-10-300x204.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-10-350x238.png 350w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<p>You must select the port that OpenVPN will operate through. By default, port 1194 is selected and displayed on the screen. It&#8217;s recommended to continue with this default port. Select &#8216;Ok&#8217; and press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79283 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-11.png\" alt=\"\" width=\"651\" height=\"445\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-11.png 651w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-11-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-11-348x238.png 348w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<p>You&#8217;ll be prompted to confirm the port for the OpenVPN installation. Select &#8216;Yes&#8217; and press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79284 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-12.png\" alt=\"\" width=\"650\" height=\"445\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-12.png 650w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-12-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-12-348x238.png 348w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>You&#8217;ll see a list of DNS service providers. Choose the DNS provider with the URL for your VPN&#8217;s IP address. You can move through the list using your arrow keys and select the correct DNS provider by pressing the space bar.<\/p>\n<p>Here, we are selecting &#8220;cloudfare&#8221; as our DNS provider. Afterwards, select &#8216;Ok&#8217; and press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79285 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-13.png\" alt=\"\" width=\"648\" height=\"443\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-13.png 648w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-13-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-13-348x238.png 348w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>Next, decide whether you want to use a public IP address or a DNS entry. If you&#8217;re using a dynamic IP address, go with the DNS entry. Otherwise, choose the static public IP address.<\/p>\n<p>In our example, we&#8217;re using a static public IP address. Move through the options using your arrow keys and select one by pressing the space bar. Then, select &#8216;Ok&#8217; and press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79286 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-14.png\" alt=\"\" width=\"654\" height=\"444\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-14.png 654w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-14-300x204.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-14-351x238.png 351w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/a><\/p>\n<p>A screen will appear informing you that the server key and HMAC key will be generated. Select &#8216;Ok&#8217; and press &#8216;Enter&#8217; to continue.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79287 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-15.png\" alt=\"\" width=\"651\" height=\"444\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-15.png 651w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-15-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-15-349x238.png 349w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<p>An explanation of the unattended upgrades is presented next. It will automatically download security package updates on a daily basis. Select &#8216;Ok&#8217; and press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79288 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-16.png\" alt=\"\" width=\"650\" height=\"443\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-16.png 650w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-16-300x204.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-16-349x238.png 349w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>You&#8217;ll be asked to enable unattended upgrades. Select &#8216;Yes&#8217; and press &#8216;Enter&#8217; to confirm the updates. It&#8217;s important to do so to protect Raspberry Pi from any security risks.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79289 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-17.png\" alt=\"\" width=\"652\" height=\"441\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-17.png 652w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-17-300x203.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-17-352x238.png 352w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/a><\/p>\n<p>The next screen should show that the installation of OpenVPN is complete. Select &#8216;Ok&#8217; and press &#8216;Enter.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79290 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-18.png\" alt=\"\" width=\"650\" height=\"445\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-18.png 650w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-18-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-18-348x238.png 348w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>Lastly, a screen will appear prompting you to reboot Raspberry Pi, which is necessary to complete the installation. Select &#8216;Yes&#8217; and press &#8216;Enter&#8217; to reboot RPi.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-19.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79291 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-19.png\" alt=\"\" width=\"656\" height=\"443\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-19.png 656w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-19-300x203.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-19-352x238.png 352w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-20.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79292 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-20.png\" alt=\"\" width=\"653\" height=\"445\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-20.png 653w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-20-300x204.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-20-349x238.png 349w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/a><\/p>\n<p><strong>An OpenVPN username<br \/>\n<\/strong>After completing the OpenVPN installation, it\u2019s possible to use the server. But first, it\u2019s necessary to set up an OpenVPN user. Typically, this is a cumbersome task that involves generating individual certificates for each user.<\/p>\n<p>Fortunately, with PiVPN, all of this can be done with a single command as follows.<\/p>\n<p><span style=\"color: #800000;\"><strong>sudo pivpn add<\/strong><\/span><\/p>\n<p>You\u2019ll be asked to enter a name for the client, which will act as an identifier to differentiate VPN users. You\u2019ll also be asked to enter a password. Choose \u00a0a secure password and press \u2018Enter.\u2019<\/p>\n<p>The script will initiate Easy-RSA to generate a 2048-bit RSA private key for the client and store it in the file into \/home\/pi\/openvpn folder.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-21.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79293 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-21.png\" alt=\"\" width=\"655\" height=\"443\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-21.png 655w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-21-300x203.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-21-352x238.png 352w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/a>Now, you have a client setup for OpenVPN. We\u2019ll also need to connect the VPN server to your home\/office network and its smart devices. This can be done using a secure file transfer protocol (SFTP) within your local network. You must install a file server program, such as FileZilla, for this.<\/p>\n<p>Before launching FileZilla, get the IP address of your Raspberry Pi by executing the following command in the Terminal.<\/p>\n<p><span style=\"color: #800000;\"><strong>hostname -I<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-22.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79294 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-22.png\" alt=\"\" width=\"652\" height=\"50\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-22.png 652w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-22-300x23.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-22-368x28.png 368w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/a><\/p>\n<p>Once complete, open FileZilla on your computer, and enter the IP address of Raspberry Pi preceded by &#8216;sftp:\/\/&#8217; in the host tab. Enter the Raspberry Pi username and password and tap on the &#8216;Quick Connect&#8217; button.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-23.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79295 size-large\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-23-1024x201.png\" alt=\"\" width=\"740\" height=\"145\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-23-1024x201.png 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-23-300x59.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-23-768x150.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-23-368x72.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-23.png 1200w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/a><\/p>\n<p>After logging in, locate the openvpn folder and double-click on it.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-24.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79297 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-24.png\" alt=\"\" width=\"785\" height=\"429\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-24.png 785w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-24-300x164.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-24-768x420.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-24-368x201.png 368w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/a><\/p>\n<p>Find the .opvn file in the folder and drag it to your desktop or a new folder on your computer. This .opvn file will be used to make a connection with the VPN server. The file stores all of the data required for a secure connection with the OpenVPN like IP address and the encryption keys. The only thing that it does not contain is the password for connecting with the VPN.<\/p>\n<p>Next, download the official OpenVPN client from <a href=\"https:\/\/openvpn.net\/community-downloads\/\">this link<\/a> and install the client on your computer. After you run it for the first time, you\u2019ll find it in the taskbar. Right-click on the icon of the OpenVPN client and select \u2018Import file.\u2019<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-25.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79298 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-25.png\" alt=\"\" width=\"352\" height=\"284\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-25.png 352w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-25-300x242.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-25-295x238.png 295w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/a><\/p>\n<p>A file explorer window will pop up on your computer. Go to your desktop or the folder where you have downloaded the .opvn file.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-26.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79299 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-26.png\" alt=\"\" width=\"372\" height=\"171\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-26.png 372w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-26-300x138.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-26-368x169.png 368w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Double-click the file to import it into the OpenVPN client. When the file is imported successfully, you&#8217;ll receive the below message.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-27.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79300 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-27.png\" alt=\"\" width=\"188\" height=\"137\" \/><\/a><\/p>\n<p>Right-click the OpenVPN client icon from the task bar and click on the &#8216;Connect&#8217; button.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-28.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79301 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-28.png\" alt=\"\" width=\"348\" height=\"287\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-28.png 348w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-28-300x247.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-28-289x238.png 289w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/a><\/p>\n<p>The openVPN client will read data from the .opvn file and you will be prompted to enter the password. Enter it and then click &#8216;OK.&#8217;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-29.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79302 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-29.png\" alt=\"\" width=\"181\" height=\"140\" \/><\/a><\/p>\n<p>The OpenVPN client will connect to Raspberry Pi&#8217;s OpenVPN server. The OpenVPN icon in the taskbar will turn to green once successfully connected with the VPN host. You now have a functional VPN that can connect via the internet.<\/p>\n<p><strong>Uninstalling the VPN<br \/>\n<\/strong>If for any reason, you want to remove the VPN server from Raspberry Pi, run the following command in the terminal.<\/p>\n<p><span style=\"color: #800000;\"><strong>sudo pivpn uninstall<\/strong><\/span><\/p>\n<p>You\u2019ll be asked if you want to remove each package and remove auto-updates. Select &#8216;Y&#8217; for all. Raspberry Pi will reboot after the uninstallation is completed.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-30.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79303 \" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-30.png\" alt=\"\" width=\"527\" height=\"473\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-30.png 656w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-30-300x269.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/P41-30-265x238.png 265w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cyber security is a growing concern. As homes and offices are more connected than ever, the risk of cyber attacks, identity theft, and hacking has increased significantly.\u00a0 A network has several smart devices connected to one another and the internet. In the case of a cyber-attack, each connected device is at risk. One effective way&hellip;<\/p>\n","protected":false},"author":387,"featured_media":79304,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[3993,9],"tags":[474,1481,4177,1724,4178,2064,4175,4176,918],"class_list":{"2":"type-post","18":"entry","19":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to build a Raspberry Pi VPN server<\/title>\n<meta name=\"description\" content=\"How to build a Raspberry Pi VPN server for your home or office network.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to build a Raspberry Pi VPN server\" \/>\n<meta property=\"og:description\" content=\"How to build a Raspberry Pi VPN server for your home or office network.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"520\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nikhil Agnihotri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikhil Agnihotri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/\"},\"author\":{\"name\":\"Nikhil Agnihotri\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\"},\"headline\":\"How to build a Raspberry Pi VPN server\",\"datePublished\":\"2023-08-23T03:50:40+00:00\",\"dateModified\":\"2024-01-10T02:19:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/\"},\"wordCount\":2081,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png\",\"keywords\":[\"internet\",\"network\",\"openvpn\",\"raspberrypi\",\"raspbian\",\"security\",\"virtualprivatenetwork\",\"vpn\",\"wifi\"],\"articleSection\":[\"Raspberry pi\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/\",\"url\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/\",\"name\":\"How to build a Raspberry Pi VPN server\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png\",\"datePublished\":\"2023-08-23T03:50:40+00:00\",\"dateModified\":\"2024-01-10T02:19:14+00:00\",\"description\":\"How to build a Raspberry Pi VPN server for your home or office network.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png\",\"width\":800,\"height\":520},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to build a Raspberry Pi VPN server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\",\"name\":\"Nikhil Agnihotri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"caption\":\"Nikhil Agnihotri\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to build a Raspberry Pi VPN server","description":"How to build a Raspberry Pi VPN server for your home or office network.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/","og_locale":"en_US","og_type":"article","og_title":"How to build a Raspberry Pi VPN server","og_description":"How to build a Raspberry Pi VPN server for your home or office network.","og_url":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":800,"height":520,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png","type":"image\/png"}],"author":"Nikhil Agnihotri","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Nikhil Agnihotri","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/"},"author":{"name":"Nikhil Agnihotri","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6"},"headline":"How to build a Raspberry Pi VPN server","datePublished":"2023-08-23T03:50:40+00:00","dateModified":"2024-01-10T02:19:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/"},"wordCount":2081,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png","keywords":["internet","network","openvpn","raspberrypi","raspbian","security","virtualprivatenetwork","vpn","wifi"],"articleSection":["Raspberry pi","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/","url":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/","name":"How to build a Raspberry Pi VPN server","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png","datePublished":"2023-08-23T03:50:40+00:00","dateModified":"2024-01-10T02:19:14+00:00","description":"How to build a Raspberry Pi VPN server for your home or office network.","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server.png","width":800,"height":520},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/raspberry-pi-openvpn-vpn-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"How to build a Raspberry Pi VPN server"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6","name":"Nikhil Agnihotri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","caption":"Nikhil Agnihotri"},"url":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server-600x400.png","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/08\/RPi-rotator-client-server-600x520.png","author_info":{"display_name":"Nikhil Agnihotri","author_link":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/79271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=79271"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/79271\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/79304"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=79271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=79271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=79271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}