{"id":16212,"date":"2019-03-27T08:50:12","date_gmt":"2019-03-27T08:50:12","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=16212"},"modified":"2025-04-28T08:08:17","modified_gmt":"2025-04-28T08:08:17","slug":"how-to-set-up-a-linux-vpn-server-with-openvpn","status":"publish","type":"post","link":"\/uk\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn\/","title":{"rendered":"Set up a Linux VPN Server Using OpenVPN: Connecting to Devices and Managing VPN"},"content":{"rendered":"<p>A Virtual Private Network (VPN) secures users by creating a point-to-point connection that masks their internet traffic. Although paid VPN services are widely available, you may want to set up your own Linux VPN server with OpenVPN, a popular open-source option.<\/p><p>This tutorial will show you how to set up a Linux VPN server using OpenVPN. We will explain two methods &ndash; manual and automatic, using Hostinger&rsquo;s operating system template.<\/p><p>You will also learn how to manage and test the tunnelling functionality. Moreover, we will also explain how to connect devices running various operating systems to the Linux VPN server.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet.png 2048w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-300x83.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-1536x425.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-150x41.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-768x212.png 768w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n<\/div><p>\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-why-should-you-use-a-linux-vpn-server\">Why Should You Use a Linux VPN Server<\/h2><p>Using a VPN for Linux desktops and <a href=\"\/uk\/tutorials\/what-is-vps-hosting\/\">virtual private servers<\/a> (VPSs) is one of the best ways to remain secure over the internet. Here are the key benefits of a Linux VPN server:<\/p><ul class=\"wp-block-list\">\n<li><strong>Security <\/strong>&ndash; A VPN&rsquo;s data encryption provides a higher <a href=\"\/uk\/tutorials\/vps-security\/\">VPS security<\/a> level than a firewall. For example, the VPN will securely encrypt sensitive data like transactions.<\/li>\n\n\n\n<li><strong>Remote access<\/strong> &ndash; many organizations only allow remote access through VPN to maintain security.<\/li>\n\n\n\n<li><strong>Anonymity <\/strong>&ndash; a VPN masks a user&rsquo;s actual IP address and perceived location from other parties, including the internet service provider (ISP). This ensures anonymity when browsing the internet.<\/li>\n\n\n\n<li><strong>Unblock content <\/strong>&ndash; some VPNs let you bypass region-locked content. For instance, you may be able to access another Netflix locale&rsquo;s library.<\/li>\n\n\n\n<li><strong>Bypass ISP throttling<\/strong> &ndash; certain ISPs throttle internet speed and bandwidth. A VPN may be able to stop ISP throttling.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-how-to-install-openvpn-on-a-linux-vpn-server\">How to Install OpenVPN on a Linux VPN Server<\/h2><p>In this section, we will demonstrate how to set up OpenVPN software on a VPS using an operating system template and commands. As both methods have the same outcome, choose whichever you prefer.<\/p><h3 class=\"wp-block-heading\">Prerequisites<\/h3><p>To set up a Linux VPN server, ensure you have a compatible machine. While you can set it up on a local system, we recommend using a VPS hosting service since it is more affordable and simpler to manage.<\/p><p>When choosing a VPS hosting plan, ensure it works with your chosen software. For example, <a href=\"\/uk\/vps-hosting\">Hostinger KVM plans<\/a> support various VPN solutions, providing flexibility and options for your needs.<\/p><p>In addition, your VPS must be accessible remotely via SSH and offer full root access to ensure a smooth installation process. At Hostinger, users can run commands on their server directly using the <a href=\"https:\/\/support.hostinger.com\/en\/articles\/7978544-how-to-use-the-browser-terminal\" target=\"_blank\" rel=\"noopener\">Browser Terminal<\/a> feature.<\/p><p>Lastly, your system must allow <strong>TCP over port 943<\/strong> and <strong>UDP on port 1194<\/strong> via iptables or <a href=\"\/uk\/tutorials\/how-to-configure-firewall-on-ubuntu-using-ufw\/\">Uncomplicated Firewall<\/a> (UFW). If you use Hostinger, you can do so by simply <a href=\"https:\/\/support.hostinger.com\/en\/articles\/8172641-how-to-use-vps-firewall\" target=\"_blank\" rel=\"noopener\">creating VPS firewall rules via hPane<strong>l<\/strong><\/a>.<\/p><figure class=\"wp-block-image size-large\"><a href=\"\/uk\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>Before proceeding with the VPN server installation, we recommend reading the <a href=\"https:\/\/openvpn.net\/vpn-server-resources\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenVPN documentation<\/a> to learn more about the protocol.<\/p><h3 class=\"wp-block-heading\" id=\"h-set-up-a-linux-vpn-server-with-openvpn-access-server\">Set Up a Linux VPN Server With OpenVPN Access Server<\/h3><p>To manually set up OpenVPN on a Linux server, connect to your system using an <a href=\"\/uk\/tutorials\/how-to-use-putty-ssh\/\">SSH client like PuTTY<\/a> or Hostinger&rsquo;s <strong>Browser terminal<\/strong>. Find the login credentials under the <strong>SSH access <\/strong>tab on<strong> hPanel&rsquo;s VPS overview <\/strong>menu.<\/p><p>\n\n\n<div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Instead of using <strong>root<\/strong>, switch to another account with superuser privileges when managing your server to avoid accidental destructive command execution.\n            <\/p><\/div>\n\n\n\n<\/p><p>Then, run the installation commands depending on your distribution:<\/p><p><strong>Ubuntu and Debian<\/strong> <strong>derivatives<\/strong><\/p><ol class=\"wp-block-list\">\n<li>Update the indexes using the following <a href=\"\/uk\/tutorials\/linux-commands\/\">Linux command<\/a>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt update<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>A<strong> net-tools <\/strong>package is needed to install OpenVPN successfully. If you don&rsquo;t have it installed yet, enter the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt -y install ca-certificates wget net-tools gnupg<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Download the client from the <a href=\"https:\/\/openvpn.net\/vpn-software-packages\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenVPN website<\/a>. Copy the package link and download it using the <strong>wget <\/strong>command. A sample <strong>wget<\/strong> command for Ubuntu would look like this:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">wget -qO - https:\/\/as-repository.openvpn.net\/as-repo-public.gpg | apt-key add -<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Proceed with the command below:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">echo \"deb http:\/\/as-repository.openvpn.net\/as\/debian focal main\"&gt;\/etc\/apt\/sources.list.d\/openvpn-as-repo.list<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Lastly, install the OpenVPN Access Server with the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt update &amp;&amp; apt -y install openvpn-as<\/pre><p><strong>CentOS<\/strong> <strong>and RHEL derivatives<\/strong><\/p><p>OpenVPN installation for CentOS is simpler because it only consists of two commands:<\/p><pre class=\"wp-block-preformatted\">yum -y install https:\/\/as-repository.openvpn.net\/as-repo-centos9.rpm<br>yum -y install openvpn-as<\/pre><p>Remember, the package URL differs if you are using other Red Hat Enterprise Linux (RHEL) derivatives. <\/p><p>Once the installation is complete, you will see the Admin UI and the Client UI details. Remember the password since you will use it to log in.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-terminal-window-displays-a-successful-OpenVPN-Access-server-installation.-Login-URLs-for-admin-and-client-along-with-password-and-username-is-shown.jpg\"><img decoding=\"async\" width=\"1024\" height=\"293\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-terminal-window-displays-a-successful-OpenVPN-Access-server-installation.-Login-URLs-for-admin-and-client-along-with-password-and-username-is-shown.jpg\/w=1024,h=1024,fit=scale-down\" alt=\"The terminal window displays a successful OpenVPN Access server installation. Login URLs for admin and client, along with password and username, is shown\" class=\"wp-image-76073\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-terminal-window-displays-a-successful-OpenVPN-Access-server-installation.-Login-URLs-for-admin-and-client-along-with-password-and-username-is-shown.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-terminal-window-displays-a-successful-OpenVPN-Access-server-installation.-Login-URLs-for-admin-and-client-along-with-password-and-username-is-shown-300x86.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-terminal-window-displays-a-successful-OpenVPN-Access-server-installation.-Login-URLs-for-admin-and-client-along-with-password-and-username-is-shown-150x43.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-terminal-window-displays-a-successful-OpenVPN-Access-server-installation.-Login-URLs-for-admin-and-client-along-with-password-and-username-is-shown-768x220.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><h3 class=\"wp-block-heading\">Set Up a Linux VPN Server With Hostinger OpenVPN VPS Template<\/h3><p>Installing OpenVPN might be complicated for VPS or Linux beginners as it requires executing various commands. However, Hostinger users can easily do so in one click <a href=\"https:\/\/support.hostinger.com\/en\/articles\/4965922-how-to-change-the-operating-system-of-vps\" target=\"_blank\" rel=\"noopener\">using an operating system template<\/a>, which is bundled with an application or control panel.<\/p><p>In addition to being simple, this method is safer since you won&rsquo;t run wrong commands that might break your server. We provide <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583571-what-are-the-available-operating-systems-for-vps\" target=\"_blank\" rel=\"noopener\">different VPS operating system templates<\/a> pre-installed with various software.<\/p><p>For example, we offer the <strong>Ubuntu 22.04 64bit with OpenVPN <\/strong>template. Follow these steps to install it:<\/p><ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/hpanel.hostinger.com\/\" target=\"_blank\" rel=\"noopener\">Log in to <strong>hPanel<\/strong><\/a> and click<strong> VPS <\/strong>on the top menu.<\/li>\n\n\n\n<li>Select the VPS you want to install OpenVPN on.<\/li>\n\n\n\n<li>Navigate to the sidebar &rarr; <strong>OS &amp; Panels <\/strong>&rarr; <strong>Operating System<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Applications<\/strong>.<\/li>\n\n\n\n<li>Select <strong>OpenVPN<\/strong> from the list and click <strong>Change OS<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"6a57b0ed4b5e6\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a57b0ed4b5e6\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1460\" height=\"332\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2019\/03\/the-openvpn-vps-template-on-hpanel-operating-system-installation-page.png\/w=1024,h=1024,fit=scale-down\" alt=\"The OpenVPN template on hPanel's VPS operating system configuration menu\" class=\"wp-image-125837\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2019\/03\/the-openvpn-vps-template-on-hpanel-operating-system-installation-page.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2019\/03\/the-openvpn-vps-template-on-hpanel-operating-system-installation-page.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2019\/03\/the-openvpn-vps-template-on-hpanel-operating-system-installation-page.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2019\/03\/the-openvpn-vps-template-on-hpanel-operating-system-installation-page.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2019\/03\/the-openvpn-vps-template-on-hpanel-operating-system-installation-page.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div><p>Wait until the process is complete, which should take a few minutes. During the installation, you can&rsquo;t access or modify your server.<\/p><p>\n\n\n    <div class=\"announcement-block announcement-block--warning\">\n        <span class=\"announcement-block__heading\">\n            <svg width=\"24\" height=\"26\" viewBox=\"0 0 24 26\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                d=\"M12 23.5C17.799 23.5 22.5 18.799 22.5 13C22.5 7.20101 17.799 2.5 12 2.5C6.20101 2.5 1.5 7.20101 1.5 13C1.5 18.799 6.20101 23.5 12 23.5ZM13.637 8.65198C13.637 7.74791 12.9041 7.01501 12 7.01501C11.0959 7.01501 10.363 7.74791 10.363 8.65198C10.5335 10.5375 10.875 14.383 10.875 14.383C10.875 15.0043 11.3787 15.508 12 15.508C12.6213 15.508 13.125 15.0043 13.125 14.383V14.38L13.637 8.65198ZM11.9927 16.714C11.3714 16.714 10.8677 17.2177 10.8677 17.839C10.8677 18.4603 11.3714 18.964 11.9927 18.964H12.0073C12.6286 18.964 13.1323 18.4603 13.1323 17.839C13.1323 17.2177 12.6286 16.714 12.0073 16.714H11.9927Z\"\n                fill=\"#BE1025\"\/>\n            <\/svg>\n            Warning        <\/span>\n        <p class=\"announcement-block__content\">\n            <strong>Warning!<\/strong> Back up your VPS data before changing or reinstalling its operating system as the process will wipe all the data.        <\/p>\n    <\/div>\n\n    \n\n\n\n<\/p><p>Remember, you can only use <strong>Ubuntu 22.04<\/strong> if you install OpenVPN using this method. To run other distributions, you must set up the application and operating system separately using commands.<\/p><h2 class=\"wp-block-heading\" id=\"h-set-up-openvpn-dashboard-and-account\">Set Up OpenVPN Dashboard and Account<\/h2><p>Regardless of the installation method, you must configure the OpenVPN settings and account via the admin dashboard to complete the setup process. Here are the steps:<\/p><ol class=\"wp-block-list\">\n<li>Open the admin URL using your VPS IP address with <strong>943<\/strong> port and<strong> \/admin <\/strong>subdomain. For example, it should look like <strong>https:\/\/185.185.185.185:943\/admin<\/strong>.<\/li>\n\n\n\n<li>On the login page, enter the credentials shown in Terminal during the installation steps. If you use the template, enter <strong>openvpn <\/strong>as the username and use the password you provided when setting up the operating system. Click <strong>Sign In<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-login-page.png\"><img decoding=\"async\" width=\"954\" height=\"888\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-login-page.png\/public\" alt=\"The main OpenVPN login page\" class=\"wp-image-76074\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-login-page.png 954w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-login-page-300x279.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-login-page-150x140.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-login-page-768x715.png 768w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/a><\/figure>\n<\/div><p>\n\n        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                     Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\">If you see the <a href=\"\/uk\/tutorials\/your-connection-is-not-private-error\/\">Your connection is not private error<\/a>, an SSL certificate may not be installed on the VPS server. Click <strong>Continue to the site<\/strong> to proceed to the web interface.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><ol start=\"3\" class=\"wp-block-list\">\n<li>Once logged in, you will see a Terms and Conditions page. Read it and press the <strong>Agree<\/strong> button to proceed. The next page will provide the OpenVPN configuration details and the server status.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-Status-Overview-page-on-OpenVPN-Access-Server-dashboard.png\"><img decoding=\"async\" width=\"1024\" height=\"399\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-Status-Overview-page-on-OpenVPN-Access-Server-dashboard.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Status Overview page on OpenVPN Access Server dashboard\" class=\"wp-image-76075\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-Status-Overview-page-on-OpenVPN-Access-Server-dashboard.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-Status-Overview-page-on-OpenVPN-Access-Server-dashboard-300x117.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-Status-Overview-page-on-OpenVPN-Access-Server-dashboard-150x58.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-Status-Overview-page-on-OpenVPN-Access-Server-dashboard-768x299.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Click the <strong>Start VPN services <\/strong>button on the OpenVPN Admin panel. The VPN service status should show as <strong>ON<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-status-overview-page-on-OpenVPN-dashboard-it-showcases-that-VPN-services-are-currently-ON.png\"><img decoding=\"async\" width=\"1024\" height=\"132\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-status-overview-page-on-OpenVPN-dashboard-it-showcases-that-VPN-services-are-currently-ON.png\/w=1024,h=1024,fit=scale-down\" alt=\"The status overview page on OpenVPN dashboard, it showcases that VPN services are currently ON\" class=\"wp-image-76077\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-status-overview-page-on-OpenVPN-dashboard-it-showcases-that-VPN-services-are-currently-ON.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-status-overview-page-on-OpenVPN-dashboard-it-showcases-that-VPN-services-are-currently-ON-300x39.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-status-overview-page-on-OpenVPN-dashboard-it-showcases-that-VPN-services-are-currently-ON-150x19.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-status-overview-page-on-OpenVPN-dashboard-it-showcases-that-VPN-services-are-currently-ON-768x99.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>The default OpenVPN settings are sufficient for normal use and compatible with macOS, Linux, Windows, Android, and iOS. However, if you want to tweak your Linux VPN server configuration, click <strong>Apply <\/strong>and <strong>Update Running Server<\/strong> to enable the changes.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/A-window-from-the-OpenVPN-dashboard-whenever-a-user-changes-settings.-Update-running-server-button-is-highlighted.png\"><img decoding=\"async\" width=\"1354\" height=\"374\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/A-window-from-the-OpenVPN-dashboard-whenever-a-user-changes-settings.-Update-running-server-button-is-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"A window from the OpenVPN dashboard whenever a user changes settings. Update running server button is highlighted\" class=\"wp-image-76079\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/A-window-from-the-OpenVPN-dashboard-whenever-a-user-changes-settings.-Update-running-server-button-is-highlighted.png 1354w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/A-window-from-the-OpenVPN-dashboard-whenever-a-user-changes-settings.-Update-running-server-button-is-highlighted-300x83.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/A-window-from-the-OpenVPN-dashboard-whenever-a-user-changes-settings.-Update-running-server-button-is-highlighted-1024x283.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/A-window-from-the-OpenVPN-dashboard-whenever-a-user-changes-settings.-Update-running-server-button-is-highlighted-150x41.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/A-window-from-the-OpenVPN-dashboard-whenever-a-user-changes-settings.-Update-running-server-button-is-highlighted-768x212.png 768w\" sizes=\"(max-width: 1354px) 100vw, 1354px\" \/><\/a><\/figure>\n<\/div><p>\n\n<div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Keep in mind that the free version of OpenVPN allows <strong>up to two concurrent connections<\/strong> only.\n            <\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-set-up-openvpn-server-tunneling\">Set Up OpenVPN Server Tunneling<\/h2><p>A VPN tunnel is an encrypted connection between your device and the VPN. Follow these steps to enable it:<\/p><ol class=\"wp-block-list\">\n<li>To enable IP forwarding in your kernel, turn on traffic forwarding over IPv4 using the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">echo 'net.ipv4.ip_forward=1' | sudo tee -a \/etc\/sysctl.d\/99-sysctl.conf<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>To apply the changes, enter:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo sysctl -p<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Since the OpenVPN tunnel does not support simultaneous connections over IPv6 and IPv4 protocols, disable the latter by running these commands subsequently:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1<\/pre><pre class=\"wp-block-preformatted\">sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>To ensure IPv6 is disabled, turn it off manually by modifying the<strong> 99-sysctl.conf<\/strong> file in <strong>\/etc\/sysctl.d\/ <\/strong><a href=\"\/uk\/tutorials\/how-to-install-and-use-nano-text-editor\/\">using a text editor like <strong>nano<\/strong>.<\/a> To do so, run the following commands:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo cd \/etc\/sysctl.d\/<\/pre><pre class=\"wp-block-preformatted\">sudo nano 99-sysctl.conf<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Set the following parameters inside the file. Press<strong> Ctrl + X<\/strong>, <strong>Y<\/strong>, and <strong>Enter <\/strong>to save the changes.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">net.ipv6.conf.all.disable_ipv6 = 1<\/pre><pre class=\"wp-block-preformatted\">net.ipv6.conf.default.disable_ipv6 = 1<\/pre><pre class=\"wp-block-preformatted\">net.ipv6.conf.lo.disable_ipv6 = 1<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Activate the new settings using this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sysctl -p<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>Open the <strong>\/etc\/hosts<\/strong> file using nano and add a hash sign (<strong>#<\/strong>) at the start of the IPv6 resolution line as shown below:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">#::1 localhost ip6-localhost ip6-loopback<\/pre><ol start=\"8\" class=\"wp-block-list\">\n<li>Log in to the<strong> OpenVPN admin dashboard <\/strong>and open <strong>VPN Settings<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/openvpn-vpn-settings-menu.jpg\"><img decoding=\"async\" width=\"309\" height=\"621\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2024\/03\/openvpn-vpn-settings-menu.jpg\/public\" alt=\"OpenVPN dashboard side bar with VPN Settings button selected\" class=\"wp-image-105873\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2024\/03\/openvpn-vpn-settings-menu.jpg\/w=309,fit=scale-down 309w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2024\/03\/openvpn-vpn-settings-menu.jpg\/w=149,fit=scale-down 149w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/51\/2024\/03\/openvpn-vpn-settings-menu.jpg\/w=75,fit=scale-down 75w\" sizes=\"(max-width: 309px) 100vw, 309px\" \/><\/a><\/figure>\n<\/div><ol start=\"9\" class=\"wp-block-list\">\n<li>In the <strong>Routing <\/strong>section, set the <strong>Should VPN clients have access to private subnets (non-public networks on the server side)? <\/strong>option to <strong>No<\/strong>. Then, set the <strong>Should client Internet traffic be routed through the VPN? <\/strong>option to <strong>Yes<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-routing-section-on-the-OpenVPN-dashboard.png\"><img decoding=\"async\" width=\"1024\" height=\"220\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-routing-section-on-the-OpenVPN-dashboard.png\/w=1024,h=1024,fit=scale-down\" alt=\"The routing section on the OpenVPN dashboard\" class=\"wp-image-76081\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-routing-section-on-the-OpenVPN-dashboard.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-routing-section-on-the-OpenVPN-dashboard-300x65.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-routing-section-on-the-OpenVPN-dashboard-150x32.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-routing-section-on-the-OpenVPN-dashboard-768x165.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"10\" class=\"wp-block-list\">\n<li>To avoid any DNS leak, alter the DNS resolver settings. Enable the <strong>Have clients use the same DNS servers <\/strong>option.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-DNS-settings-section-on-the-OpenVPN-dashboard.png\"><img decoding=\"async\" width=\"1024\" height=\"234\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-DNS-settings-section-on-the-OpenVPN-dashboard.png\/w=1024,h=1024,fit=scale-down\" alt=\"The DNS settings section on the OpenVPN dashboard\" class=\"wp-image-76082\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-DNS-settings-section-on-the-OpenVPN-dashboard.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-DNS-settings-section-on-the-OpenVPN-dashboard-300x69.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-DNS-settings-section-on-the-OpenVPN-dashboard-150x34.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-DNS-settings-section-on-the-OpenVPN-dashboard-768x176.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"11\" class=\"wp-block-list\">\n<li>Save the new settings and click <strong>Update Running Server<\/strong>.<\/li>\n\n\n\n<li>Navigate to the <strong>Status <\/strong>tab. Click <strong>Stop<\/strong> and then <strong>Start<\/strong> to reboot the OpenVPN server.<\/li>\n<\/ol><h2 class=\"wp-block-heading\" id=\"h-how-to-connect-linux-vpn-server-to-other-devices\">How to Connect Linux VPN Server to Other Devices<\/h2><p>Now that the server is running, users can connect devices to it. We&rsquo;ll cover the most popular operating system options: Windows, macOS, Linux, Android, and iOS.<\/p><h3 class=\"wp-block-heading\">How to Install and Connect the OpenVPN Client for Windows<\/h3><ol class=\"wp-block-list\">\n<li>Open the OpenVPN client URL: <a href=\"https:\/\/185.185.185.185:943\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>https:\/\/185.185.185.185:943\/<\/strong><\/a>. Replace the IP address with your VPS&rsquo;.<\/li>\n\n\n\n<li>Choose the Windows version of the client and run the installation.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-Windows-machine.png\"><img decoding=\"async\" width=\"520\" height=\"504\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-Windows-machine.png\/public\" alt=\"The main OpenVPN client dashboard view for a Windows machine\" class=\"wp-image-76084\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-Windows-machine.png 520w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-Windows-machine-300x291.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-Windows-machine-150x145.png 150w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/a><\/figure>\n<\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Once the installation is complete, a prompt will appear. Enter your OpenVPN username and password.<\/li>\n\n\n\n<li>Run OpenVPN from the Windows taskbar to disconnect, reconnect and view the connection status.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-how-to-install-and-connect-the-openvpn-client-for-macos\">How to Install and Connect the OpenVPN Client for macOS<\/h3><ol class=\"wp-block-list\">\n<li>Connect to the OpenVPN client UI and <a href=\"https:\/\/openvpn.net\/client-connect-vpn-for-mac-os\/\" target=\"_blank\" rel=\"noreferrer noopener\">download the OpenVPN Connect software for macOS<\/a>..<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-macOS-machine.png\"><img decoding=\"async\" width=\"952\" height=\"994\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-macOS-machine.png\/public\" alt=\"The main OpenVPN client dashboard view for a macOS machine\" class=\"wp-image-76085\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-macOS-machine.png 952w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-macOS-machine-287x300.png 287w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-macOS-machine-144x150.png 144w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-for-a-macOS-machine-768x802.png 768w\" sizes=\"(max-width: 952px) 100vw, 952px\" \/><\/a><\/figure>\n<\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Follow the macOS setup wizard procedure to complete the installation.<\/li>\n\n\n\n<li>A new OpenVPN icon on the macOS taskbar will appear. Right-click on this icon to see the different options.<\/li>\n\n\n\n<li>Click the <strong>Connect to<\/strong> option. A pop-up will prompt for your OpenVPN username and password. Enter the credentials.<\/li>\n\n\n\n<li>Click <strong>Connect<\/strong> to establish the Linux VPN server connection.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-how-to-install-and-connect-the-openvpn-client-for-linux\">How to Install and Connect the OpenVPN Client for Linux<\/h3><p>The client installation for Linux differs from Windows and macOS since it requires commands. Open Terminal by pressing<strong> Ctrl + Alt + T<\/strong> and follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Download and install the OpenVPN client software by running the package manager command. For Debian derivatives like Ubuntu, use:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt-get install openvpn<\/pre><p>Meanwhile, run the following if you use CentOS 9 Stream or older:<\/p><pre class=\"wp-block-preformatted\">sudo yum install openvpn<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Open the OpenVPN client UI and download the appropriate profile for your OS. You can also do so using the <a href=\"\/uk\/tutorials\/curl-command-with-examples-linux\/\"><strong>curl command<\/strong><\/a> with the download link.<\/li>\n\n\n\n<li>Copy the downloaded profile to <strong>\/etc\/openvpn<\/strong> and rename it to <strong>client.conf<\/strong>.<\/li>\n\n\n\n<li>Return to <strong>Terminal <\/strong>and start the OpenVPN Tunnel service by entering the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo service openvpn start<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>A prompt asking for your OpenVPN username and password will appear. Enter the correct credentials.<\/li>\n\n\n\n<li>Once the VPN interface is available, <strong>tun0<\/strong> should show up in the existing network adapters list. To check it, run <strong>ipconfig<\/strong> or <strong>ip addr<\/strong> in <strong>Terminal<\/strong>.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-how-to-install-and-connect-the-openvpn-client-for-android\">How to Install and Connect the OpenVPN Client for Android<\/h3><p>To connect to your OpenVPN Linux server from an Android device, open<strong> Google Play<\/strong> and install the <strong>OpenVPN Connect <\/strong>application.<\/p><p>Import a profile by entering the VPN server client URL, namely your VPS IP address with the OpenVPN port. Then, enter the following details:<\/p><ul class=\"wp-block-list\">\n<li><strong>Port<\/strong> &ndash; 934 of your Linux VPN server.<\/li>\n\n\n\n<li><strong>Username<\/strong> &ndash; the username set on your server. It is openvpn by default.<\/li>\n\n\n\n<li><strong>Password<\/strong> &ndash; the password that Terminal displayed after successfully installing OpenVPN Access Server or the one you entered when setting up the VPS template.<\/li>\n<\/ul><p>Alternatively, use the client UI to import the <strong>OVPN<\/strong> file, which you must create first using the template within the <strong>\/etc\/openvpn\/easy-rsa<\/strong> directory on your VPS.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-client-dashboard-view-with-profile-download-option-highlighted.png\"><img decoding=\"async\" width=\"1008\" height=\"706\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-main-OpenVPN-client-dashboard-view-with-profile-download-option-highlighted.png\/public\" alt=\"The main OpenVPN client dashboard view with profile download option highlighted\n\" class=\"wp-image-76086\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-with-profile-download-option-highlighted.png 1008w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-with-profile-download-option-highlighted-300x210.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-with-profile-download-option-highlighted-150x105.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-main-OpenVPN-client-dashboard-view-with-profile-download-option-highlighted-768x538.png 768w\" sizes=\"(max-width: 1008px) 100vw, 1008px\" \/><\/a><\/figure>\n<\/div><h3 class=\"wp-block-heading\" id=\"h-how-to-install-and-connect-the-openvpn-client-for-ios\">How to Install and Connect the OpenVPN Client for iOS<\/h3><p>To connect the OpenVPN client on iOS, download the <strong>OpenVPN Connect <\/strong>application from the <strong>App Store<\/strong>. Open the application and fill in all the required profile information or upload the profile file.<\/p><p>Refer to the previous section for the complete steps since configuring OpenVPN Connect on iOS is similar to Android.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-manage-linux-vpn-server\">How to Manage Linux VPN Server<\/h2><p>Now that the VPN Access Server is running, check its configuration settings to ensure it works properly.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-manage-linux-vpn-server-compression-settings\">How to Manage Linux VPN Server Compression Settings<\/h3><p>If you are connected to the VPN but cannot browse the Internet, check the OpenVPN logs at <strong>\/var\/log\/openvpnas.log<\/strong> on the Access Server VPS.<\/p><p>If you find entries similar to the ones below, you are likely experiencing compression issues:<\/p><pre class=\"wp-block-preformatted\">2022-03-23 18:24:05+0800 [-] OVPN 11 OUT: 'Mon Mar 23 08:59:05 2016 guest\/123.45.67.89:55385 Bad compression stub decompression header byte: 251'<\/pre><p>Resolve this error by disabling compression:<\/p><ol class=\"wp-block-list\">\n<li>Open the Admin console and click <strong>Advanced VPN<\/strong>.<\/li>\n\n\n\n<li>Go to <strong>Default Compression Settings<\/strong> and turn off <strong>Support compression on client VPN connections<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-default-compression-settings-on-a-OpenVPN-dashboard.png\"><img decoding=\"async\" width=\"1024\" height=\"145\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-default-compression-settings-on-a-OpenVPN-dashboard.png\/w=1024,h=1024,fit=scale-down\" alt=\"The default compression settings on a OpenVPN dashboard\" class=\"wp-image-76087\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-default-compression-settings-on-a-OpenVPN-dashboard.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-default-compression-settings-on-a-OpenVPN-dashboard-300x42.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-default-compression-settings-on-a-OpenVPN-dashboard-150x21.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-default-compression-settings-on-a-OpenVPN-dashboard-768x109.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Apply the changes and click on the <strong>Update Running Server<\/strong> option.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-how-to-add-users-to-a-linux-vpn-server-running-openvpn\">How to Add Users to a Linux VPN Server Running OpenVPN<\/h3><p>Although you can create multiple accounts, the free OpenVPN client supports<strong> two concurrent user connections<\/strong>. You must purchase the paid plan to enable more users to use the server.<\/p><p>To add and manage users, open the Admin dashboard and follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to <strong>User Management &rarr; User Permissions<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-OpenVPN-side-bar-with-User-Permissions-button-selected-1.png\"><img decoding=\"async\" width=\"458\" height=\"726\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-OpenVPN-side-bar-with-User-Permissions-button-selected-1.png\/public\" alt=\"The OpenVPN side bar with User Permissions button selected\" class=\"wp-image-76088\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-OpenVPN-side-bar-with-User-Permissions-button-selected-1.png 458w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-OpenVPN-side-bar-with-User-Permissions-button-selected-1-189x300.png 189w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-OpenVPN-side-bar-with-User-Permissions-button-selected-1-95x150.png 95w\" sizes=\"(max-width: 458px) 100vw, 458px\" \/><\/a><\/figure>\n<\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Enter the new <strong>username<\/strong> as shown below:<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.png\"><img decoding=\"async\" width=\"1406\" height=\"786\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.png\/w=1024,h=1024,fit=scale-down\" alt=\"The User Permissions section on the OpenVPN dashboard\" class=\"wp-image-76091\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.png 1406w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard-300x168.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard-1024x572.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard-150x84.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard-768x429.png 768w\" sizes=\"(max-width: 1406px) 100vw, 1406px\" \/><\/a><\/figure>\n<\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>For a new user, click <strong>More Settings <\/strong>to change other configurations like its password and permissions.<\/li>\n\n\n\n<li>Save the new settings and click <strong>Update Running Server<\/strong>.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-how-to-set-up-auto-login-profiles-for-a-linux-vpn-server-with-openvpn\">How to Set Up Auto-Login Profiles for a Linux VPN Server With OpenVPN<\/h3><p>OpenVPN lets you configure auto-login profiles, which will automatically route all non-local traffic via the VPN.<\/p><p>To set up auto-login, open the Admin dashboard<strong> <\/strong>and select <strong>User Permissions<\/strong>. Then, check the <strong>Allow Auto-login <\/strong>box on the profile you want to modify.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/uk\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.-Allow-Auto-login-button-is-highlighted.png\"><img decoding=\"async\" width=\"1534\" height=\"802\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.-Allow-Auto-login-button-is-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The User Permissions section on the OpenVPN dashboard\" class=\"wp-image-76089\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.-Allow-Auto-login-button-is-highlighted.png 1534w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.-Allow-Auto-login-button-is-highlighted-300x157.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.-Allow-Auto-login-button-is-highlighted-1024x535.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.-Allow-Auto-login-button-is-highlighted-150x78.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2019\/03\/The-User-Permissions-section-on-the-OpenVPN-dashboard.-Allow-Auto-login-button-is-highlighted-768x402.png 768w\" sizes=\"(max-width: 1534px) 100vw, 1534px\" \/><\/a><\/figure>\n<\/div><p>Alternatively, use <strong>User <\/strong>or <strong>Server<\/strong>-locked profiles to manually enable or disable the VPN.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-test-a-linux-vpn-server-running-openvpn\">How to Test a Linux VPN Server Running OpenVPN<\/h2><p>Connect to the VPN client and check your IP to see if the OpenVPN server works as expected. You can use online tools like <a href=\"https:\/\/nordvpn.com\/what-is-my-ip\/\" target=\"_blank\" rel=\"noreferrer noopener\">NordVPN&rsquo;s What is My IP<\/a> to check whether your IPv4 address changes.<\/p><p>Next, run a <a href=\"https:\/\/dnsleaktest.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">DNS leak test<\/a> to check your OpenVPN server&rsquo;s IPv4 address. On the website, choose the <strong>Extended test<\/strong>. The output should show the client devices&rsquo; DNS resolver IPs.<\/p><p>In addition, ensure the traffic uses the IPv4 protocol using <a href=\"https:\/\/test-ipv6.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Test your IPv6<\/a>. The tool should display the server IP and a message stating that no IPv6 address was detected.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Setting up a VPN server can be beneficial, especially if you want to encrypt internet traffic and browse safely. In this article, we have explained how to configure one in a Linux VPS using OpenVPN.<\/p><p>To do so, download and install the software package using your package manager commands, like APT for Debian or yum for CentOS. Alternatively, Hostinger users can set it up in one click using a VPS template via hPanel.<\/p><p>We&rsquo;ve also shown the OpenVPN server configuration procedure and client installations on various operating systems, including Windows, Linux, Android, iOS, and macOS.<\/p><p>We hope that you found this tutorial helpful. In case you have any questions, let us know in the comments section below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Virtual Private Network (VPN) secures users by creating a point-to-point connection that masks their internet traffic. Although paid VPN services are widely available, you may want to set up your own Linux VPN server with OpenVPN, a popular open-source option. This tutorial will show you how to set up a Linux VPN server using [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/uk\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":279,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Set Up and Manage a Linux VPN Server Using OpenVPN","rank_math_description":"Protect yourself with a Linux VPN server. Follow this guide to get one on Ubuntu and CentOS, and how to use it with other OS like Windows.","rank_math_focus_keyword":"linux vpn server","footnotes":""},"categories":[22641,22640],"tags":[],"class_list":["post-16212","post","type-post","status-publish","format-standard","hentry","category-vps-use-cases","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/configurer-un-serveur-vpn-linux-avec-openvpn","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/membuat-vpn-server","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/16212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/users\/279"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/comments?post=16212"}],"version-history":[{"count":39,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/16212\/revisions"}],"predecessor-version":[{"id":125839,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/16212\/revisions\/125839"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media?parent=16212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/categories?post=16212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/tags?post=16212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}