{"id":3808,"date":"2023-02-21T17:53:30","date_gmt":"2023-02-21T17:53:30","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=3808"},"modified":"2024-08-07T09:56:11","modified_gmt":"2024-08-07T09:56:11","slug":"how-to-install-openvpn-server-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/","title":{"rendered":"How to Install OpenVPN Server on Ubuntu"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en.jpg\" alt=\"Install Open VPN Server on Ubuntu 18.04 20.04 22.04\" class=\"wp-image-3844\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>OpenVPN is a free, open-source VPN (Virtual Private Network) software that allows you to securely connect to a remote network over the internet. In this article, we will guide you through the process of installing OpenVPN on an Ubuntu server 18.04\/20.04\/22.04.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method 1:<\/h2>\n\n\n\n<p>Installing OpenVPN using a Script.<\/p>\n\n\n\n<p>First, get the script and make it executable:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ curl -O https:\/\/raw.githubusercontent.com\/angristan\/openvpn-install\/master\/openvpn-install.sh\n$ chmod +x openvpn-install.sh<\/code><\/pre>\n\n\n\n<p>Then run it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ .\/openvpn-install.sh<\/code><\/pre>\n\n\n\n<p>You need to run the script as root and have the TUN module enabled.<\/p>\n\n\n\n<p>The first time you run it, you&#8217;ll have to follow the assistant and answer a few questions to setup your VPN server.<\/p>\n\n\n\n<p>When OpenVPN is installed, you can run the script again, and you will get the choice to:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@ubuntu:~# .\/openvpn-install.sh\nWelcome to OpenVPN-install!\nThe git repository is available at: https:\/\/github.com\/angristan\/openvpn-install\n\nIt looks like OpenVPN is already installed.\n\nWhat do you want to do?\n   1) Add a new user\n   2) Revoke existing user\n   3) Remove OpenVPN\n   4) Exit\nSelect an option [1-4]:<\/pre>\n\n\n\n<p>you can add a new user or revoke an existant user .<\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method 2 :<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1-update-and-upgrade-ubuntu\">Step 1: Update and Upgrade Ubuntu<\/h2>\n\n\n\n<p>Before installing any new software, it is always recommended to update and upgrade your Ubuntu system. You can do this by running the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ <span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\">sudo apt update<\/span>&nbsp;\n$ <span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\">sudo apt upgrade<\/span><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-install-openvpn\">Step 2: Install OpenVPN<\/h2>\n\n\n\n<p>You can install OpenVPN on Ubuntu by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt install openvpn easy-rsa<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3-generate-certificates-and-keys\">Step 3: Generate Certificates and Keys<\/h2>\n\n\n\n<p>OpenVPN uses certificates and keys to authenticate clients and servers. You can generate these files by running the easy-rsa script included with OpenVPN. To do this, follow these steps:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ make-cadir ~\/openvpn-ca &amp;&amp; cd ~\/openvpn-ca<\/code><\/pre>\n\n\n\n<p>&nbsp;Edit the&nbsp;<code>vars<\/code>&nbsp;file to set up the Certificate Authority (CA) variables:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">$ nano .\/vars<\/code><\/pre>\n\n\n\n<p>Edit the variables as needed, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">set_var EASYRSA_REQ_COUNTRY    \"US\"\nset_var EASYRSA_REQ_PROVINCE   \"California\"\nset_var EASYRSA_REQ_CITY       \"San Francisco\"\nset_var EASYRSA_REQ_ORG        \"Copyleft Certificate Co\"\nset_var EASYRSA_REQ_EMAIL      \"me@example.net\"\nset_var EASYRSA_REQ_OU         \"My Organizational Unit\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$<span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\"> .\/easyrsa init-pki<\/span>\n$<span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\"> .\/easyrsa build-c<\/span>a\n$ <span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\">.\/easyrsa gen-req server nopass<\/span>\n$ <span style=\"background-color: rgba(248, 248, 242, 0.2); font-family: inherit; font-size: inherit;\">.\/easyrsa sign-req server server<\/span>\n<span style=\"background-color: initial; font-family: inherit; font-size: inherit;\">$ .\/easyrsa gen-dh<\/span>\n<span style=\"background-color: rgba(248, 248, 242, 0.2); font-family: inherit; font-size: inherit;\"><\/span>$ openvpn --genkey --secret pki\/ta.key<\/code><\/pre>\n\n\n\n<p>The certificates and keys will be created in the&nbsp;<code>\/root\/openvpn-ca\/pki<\/code>&nbsp;directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-4-configure-openvpn\">Step 4: Configure OpenVPN<\/h2>\n\n\n\n<p>After generating the certificates and keys, you need to configure OpenVPN. To do this, create a new configuration file with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo cp pki\/dh.pem pki\/ca.crt pki\/ta.key pki\/issued\/server.crt pki\/private\/server.key \/etc\/openvpn\/\n$ sudo cp \/usr\/share\/doc\/openvpn\/examples\/sample-config-files\/server.conf \/etc\/openvpn\/server.conf<\/code><\/pre>\n\n\n\n<p>Edit the following content in the configuration file <code>\/etc\/openvpn\/server.conf<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">ca ca.crt\ncert server.crt\nkey server.key  # This file should be kept secret\ndh dh.pem\n;tls-auth ta.key 0\ntls-crypt ta.key\npush \"redirect-gateway def1 bypass-dhcp\"<\/code><\/pre>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<p>Enable IP Forwarding<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo nano \/etc\/sysctl.conf\n# Uncomment the following line:\nnet.ipv4.ip_forward=1<\/code><\/pre>\n\n\n\n<p>Then apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo sysctl -p<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-5-start-and-enable-openvpn\">Step 5: Start and Enable OpenVPN<\/h2>\n\n\n\n<p>You can start and enable the OpenVPN service with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ <span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\">sudo systemctl start openvpn@server<\/span>&nbsp;\n$ <span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\">sudo systemctl enable openvpn@server<\/span><\/code><\/pre>\n\n\n\n<p>The&nbsp;<code>@server<\/code>&nbsp;part specifies the name of the configuration file you created earlier.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-6-configure-firewall\">Step 6: Configure Firewall<\/h2>\n\n\n\n<p>You need to allow OpenVPN traffic through the firewall. You can do this by creating a new rule with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ <span style=\"background-color: inherit; font-family: inherit; font-size: inherit;\">sudo ufw allow OpenVPN<\/span> # ignore if you don't use firewall<\/code><\/pre>\n\n\n\n<p>Add iptables routing<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ ifconfig\n.\n.\n.\nvenet0: flags=211&lt;UP,BROADCAST,POINTOPOINT,RUNNING,NOARP&gt;  mtu 1500\n        inet 127.0.0.1  netmask 255.255.255.255  broadcast 0.0.0.0  destination 127.0.0.1\n        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 0  (UNSPEC)\n        RX packets 4825  bytes 467045 (467.0 KB)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 3331  bytes 322185 (322.1 KB)\n        TX errors 0  dropped 1167 overruns 0  carrier 0  collisions 0\n\nvenet0:0: flags=211&lt;UP,BROADCAST,POINTOPOINT,RUNNING,NOARP&gt;  mtu 1500\n        inet 7.249.98.8  netmask 255.255.255.0  broadcast 7.249.98.255  destination 7.249.98.8\n        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 0  (UNSPEC)\n.\n.<\/code><\/pre>\n\n\n\n<p>Our main network is <kbd>venet0<\/kbd> you may have <kbd>eth0<\/kbd> or something else<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo iptables -t nat -A POSTROUTING -s 10.8.0.0\/24 -o venet0 -j MASQUERADE<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-7-connect-to-openvpn-server\">Step 7: Connect to OpenVPN Server<\/h2>\n\n\n\n<p>Now that the OpenVPN server is up and running, you can connect to it from a client computer. To do this, you need to install the OpenVPN client software on your computer and download the client configuration file from the server. You can do this by running the following command on the server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ .\/easyrsa gen-req client1 nopass\n$ .\/easyrsa sign-req client client1\n$ sudo cp pki\/private\/client1.key \/etc\/openvpn\/client\/\n$ sudo cp pki\/issued\/client1.crt \/etc\/openvpn\/client\/\n$ sudo cp pki\/{ca.crt,ta.key} \/etc\/openvpn\/client\/<\/code><\/pre>\n\n\n\n<p>&nbsp;Create a client configuration file into the&nbsp;<code>\/root\/openvpn-ca<\/code>&nbsp;directory to use as your base configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo cp \/usr\/share\/doc\/openvpn\/examples\/sample-config-files\/client.conf \/root\/openvpn-ca\/<\/code><\/pre>\n\n\n\n<p>Open this file using&nbsp;<code>nano<\/code>&nbsp;and edit this variables:<\/p>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">remote 192.168.1.5 1194 # 192.168.1.5 is the server public IP\n\nuser nobody\ngroup nogroup\n\n;ca ca.crt\n;cert client.crt\n;key client.key\n;tls-auth ta.key 1\n\nkey-direction 1<\/code><\/pre>\n\n\n\n<p>Now create a script to compile the base configuration with the necessary certificate, key, and encryption files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ nano config_gen.sh<\/code><\/pre>\n\n\n\n<p>&nbsp;Add the following content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">#!\/bin\/bash\n\n# First argument: Client identifier\n\nKEY_DIR=\/etc\/openvpn\/client\nOUTPUT_DIR=\/root # change it to output directory\nBASE_CONFIG=\/root\/openvpn-ca\/client.conf # Change it to client.conf in your system\n\ncat ${BASE_CONFIG} \\\n    &lt;(echo -e '&lt;ca&gt;') \\\n    ${KEY_DIR}\/ca.crt \\\n    &lt;(echo -e '&lt;\/ca&gt;\\n&lt;cert&gt;') \\\n    ${KEY_DIR}\/${1}.crt \\\n    &lt;(echo -e '&lt;\/cert&gt;\\n&lt;key&gt;') \\\n    ${KEY_DIR}\/${1}.key \\\n    &lt;(echo -e '&lt;\/key&gt;\\n&lt;tls-crypt&gt;') \\\n    ${KEY_DIR}\/ta.key \\\n    &lt;(echo -e '&lt;\/tls-crypt&gt;') \\\n    &gt; ${OUTPUT_DIR}\/${1}.ovpn<\/code><\/pre>\n\n\n\n<p>After writing the script, save and close the config_gen.sh file.<\/p>\n\n\n\n<p>Don&#8217;t forget to make the file executable by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo chmod 700 \/root\/openvpn-ca\/config_gen.sh\n$ sudo .\/config_gen.sh client1<\/code><\/pre>\n\n\n\n<p>This command will create a new file called&nbsp;<code>client1.ovpn<\/code>&nbsp;in the&nbsp;<code>\/root\/<\/code>&nbsp;directory.<\/p>\n\n\n\n<p>Copy this file to your client computer and use it to connect to the OpenVPN server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>In this tutorial, we have shown you how to install and configure OpenVPN on an Ubuntu server. With OpenVPN, you can securely connect to a remote network and access its resources from anywhere in the world.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenVPN is a free, open-source VPN (Virtual Private Network) software that allows you to securely connect to a remote network over the internet. In this article, we will guide you through the process of installing OpenVPN on an Ubuntu server 18.04\/20.04\/22.04. Method 1: Installing OpenVPN using a Script. First, get the script and make it ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[69,3],"tags":[],"yoast_head":"\n<title>How to Install OpenVPN Server on Ubuntu - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"Learn how to install and configure OpenVPN server on Ubuntu with this step-by-step guide. Securely connect to a remote network and access its resources from anywhere in the world. Follow our tutorial for OpenVPN installation, configuration, firewall setup, and client configuration on Ubuntu.\" \/>\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.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install OpenVPN Server on Ubuntu - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"Learn how to install and configure OpenVPN server on Ubuntu with this step-by-step guide. Securely connect to a remote network and access its resources from anywhere in the world. Follow our tutorial for OpenVPN installation, configuration, firewall setup, and client configuration on Ubuntu.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-21T17:53:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-07T09:56:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"How to Install OpenVPN Server on Ubuntu\",\"datePublished\":\"2023-02-21T17:53:30+00:00\",\"dateModified\":\"2024-08-07T09:56:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\"},\"wordCount\":553,\"commentCount\":48,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"Linux system administration\",\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\",\"name\":\"How to Install OpenVPN Server on Ubuntu - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2023-02-21T17:53:30+00:00\",\"dateModified\":\"2024-08-07T09:56:11+00:00\",\"description\":\"Learn how to install and configure OpenVPN server on Ubuntu with this step-by-step guide. Securely connect to a remote network and access its resources from anywhere in the world. Follow our tutorial for OpenVPN installation, configuration, firewall setup, and client configuration on Ubuntu.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install OpenVPN Server on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781819544\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781819544\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"How to Install OpenVPN Server on Ubuntu - WebHi Tutorials &amp; Documentations","description":"Learn how to install and configure OpenVPN server on Ubuntu with this step-by-step guide. Securely connect to a remote network and access its resources from anywhere in the world. Follow our tutorial for OpenVPN installation, configuration, firewall setup, and client configuration on Ubuntu.","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.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Install OpenVPN Server on Ubuntu - WebHi Tutorials &amp; Documentations","og_description":"Learn how to install and configure OpenVPN server on Ubuntu with this step-by-step guide. Securely connect to a remote network and access its resources from anywhere in the world. Follow our tutorial for OpenVPN installation, configuration, firewall setup, and client configuration on Ubuntu.","og_url":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2023-02-21T17:53:30+00:00","article_modified_time":"2024-08-07T09:56:11+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/02\/openvpn_ubuntu_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"How to Install OpenVPN Server on Ubuntu","datePublished":"2023-02-21T17:53:30+00:00","dateModified":"2024-08-07T09:56:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/"},"wordCount":553,"commentCount":48,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["Linux system administration","Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/","url":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/","name":"How to Install OpenVPN Server on Ubuntu - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2023-02-21T17:53:30+00:00","dateModified":"2024-08-07T09:56:11+00:00","description":"Learn how to install and configure OpenVPN server on Ubuntu with this step-by-step guide. Securely connect to a remote network and access its resources from anywhere in the world. Follow our tutorial for OpenVPN installation, configuration, firewall setup, and client configuration on Ubuntu.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-openvpn-server-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"How to Install OpenVPN Server on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781819544","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781819544","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/3808"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=3808"}],"version-history":[{"count":39,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/3808\/revisions"}],"predecessor-version":[{"id":9110,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/3808\/revisions\/9110"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=3808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=3808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=3808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}