0946.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Run OpenVPN Access Server in Docker</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Docker Made Easy,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Access Server,Debian,Installation,Linux,OVPN,OpenVPN,VPN,Container,Containerization,Docker,Docker How To,Docker Installation Tutorial,Docker Simplified,Docker Tutorial,Homelab,Ubuntu,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Run OpenVPN Access Server in Docker">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="07/24/2024 07:22:34 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Run OpenVPN Access Server in Docker</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is OpenVPN Access Server?</h2>
  26. <blockquote><em>OpenVPN Access Server, [a] self-hosted VPN solution, simplifies the rapid deployment of a secure remote access and site-to-site solution with a web-based administration interface and built-in OpenVPN Connect app distribution with bundled connection profiles. -<a href="https://openvpn.net/access-server/" target="_blank">https://openvpn.net/access-server/</a></em></blockquote>
  27. <h2>Installing Docker</h2>
  28. <ol>
  29. <li>Log into the Linux based device</li>
  30. <li>Run the following commands in the terminal
  31. <div class="codeBlock"># install prerequisites<br />
  32. sudo apt install apt-transport-https ca-certificates git curl software-properties-common gnupg-agent -y<br />
  33. # add docker gpg key<br />
  34. curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
  35. # add docker software repository<br />
  36. sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
  37. # install docker<br />
  38. sudo apt install docker-ce docker-compose containerd.io -y<br />
  39. # enable and start docker service<br />
  40. sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
  41. # add the current user to the docker group<br />
  42. sudo usermod -aG docker $USER<br />
  43. # reauthenticate for the new group membership to take effect<br />
  44. su - $USER</div>
  45. </li>
  46. </ol>
  47. <h2>Running OpenVPN Access Server</h2>
  48. <ol>
  49. <li>Now that Docker is installed, run the following commands to setup the OpenVPN Access Server Docker container and run it
  50. <div class="codeBlock"># create working directory<br />
  51. mkdir ~/docker/openvpn-as -p<br />
  52. # run openvpn access server container<br />
  53. docker run -d --name openvpn-as --cap-add=NET_ADMIN -p 943:943 -p 8443:443 -p 1194:1194/udp -v ~/docker/openvpn-as:/openvpn openvpn/openvpn-as<br />
  54. # find the temporary password<br />
  55. docker logs openvpn-as | grep &#39;Auto-generated pass&#39;</div>
  56. </li>
  57. <li>Locate the line Auto-generated pass = and copy the password to your clipboard</li>
  58. <li>Open a web browser and navigate to https://DNSorIP:943/admin</li>
  59. <li>Login with the username openvpn and the Auto-generated password located earlier</li>
  60. <li>Click the Agree button to accept the EULA</li>
  61. <li>Click User Management &gt; User Permissions in the left navigation</li>
  62. <li>Click the edit icon next to the openvpn user</li>
  63. <li>Enter a new password in the Password field &gt; Click the Save Settings button</li>
  64. <li>Click Logout at the bottom of the left navigation</li>
  65. <li>Log back in with the username openvpn and the updated password</li>
  66. <li>Welcome to OpenVPN Access Server running in Docker</li>
  67. </ol>
  68. <p>Source: <a href="https://openvpn.net/as-docs/docker.html" target="_blank">https://openvpn.net/as-docs/docker.html</a></p> </div>
  69. </div>
  70. </body>
  71. </html>