{"id":11,"date":"2026-08-02T09:44:37","date_gmt":"2026-08-02T09:44:37","guid":{"rendered":"https:\/\/www.tomasz-avila.pl\/?p=11"},"modified":"2026-08-02T12:45:39","modified_gmt":"2026-08-02T12:45:39","slug":"my-own-vpn-on-a-vps","status":"publish","type":"post","link":"https:\/\/www.tomasz-avila.pl\/?p=11","title":{"rendered":"My own VPN on a VPS"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Why?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As described in the <a href=\"https:\/\/www.tomasz-avila.pl\/?p=6\" data-type=\"post\" data-id=\"6\">Privacy Project<\/a>, I use my own <strong>Domain Name Server<\/strong>. It works great in the <strong>local network<\/strong>, but I am not able to access it from outside.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s why I need my <strong>own VPN server<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"587\" src=\"https:\/\/www.tomasz-avila.pl\/wp-content\/uploads\/2026\/08\/image-14-1024x587.png\" alt=\"\" class=\"wp-image-69\" srcset=\"https:\/\/www.tomasz-avila.pl\/wp-content\/uploads\/2026\/08\/image-14-1024x587.png 1024w, https:\/\/www.tomasz-avila.pl\/wp-content\/uploads\/2026\/08\/image-14-300x172.png 300w, https:\/\/www.tomasz-avila.pl\/wp-content\/uploads\/2026\/08\/image-14-768x440.png 768w, https:\/\/www.tomasz-avila.pl\/wp-content\/uploads\/2026\/08\/image-14.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Other possible solutions<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Port Forwarding on my home router<\/strong>\n<ul class=\"wp-block-list\">\n<li>It&#8217;s not possible, because:\n<ul class=\"wp-block-list\">\n<li>I don&#8217;t have access to the admin&#8217;s configuration. <\/li>\n\n\n\n<li>I don&#8217;t have static IP.\n<ul class=\"wp-block-list\">\n<li>There are solutions like Dynamic DNS, but they are not reliable on the long run,<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Tailscale<\/strong> or other similar commercial solution\n<ul class=\"wp-block-list\">\n<li>It would work, but it&#8217;s not so much fun.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The VPN server configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The configuration is simple:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@vps-dc91297d fedora]# cat \/etc\/wireguard\/wg0.conf \n&#91;Interface]\nAddress = 10.8.0.1\/24\nListenPort = 51820\nPrivateKey = (redacted)\n\nPostUp = firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i wg0 -j ACCEPT\nPostDown = firewall-cmd --direct --remove-rule ipv4 filter FORWARD 0 -i wg0 -j ACCEPT\n\n# Example peer (add one per client)\n&#91;Peer]\nPublicKey = (redacted)\nAllowedIPs = 10.8.0.2\/32\n\n&#91;Peer]\nPublicKey = (redacted)\nAllowedIPs = 10.8.0.3\/32<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">The VPN Clients&#8217; configuration<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>root@komputer01:\/etc\/wireguard# cat wg0.conf \n&#91;Interface]\nPrivateKey = (redacted)\nAddress = 10.8.0.3\/24\n\n&#91;Peer]\nPublicKey = (redacted) \nEndpoint = vpn.tomasz-avila.pl:51820\nAllowedIPs = 10.8.0.0\/24   # route all VPN traffic through the server\nPersistentKeepalive = 25<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">The results<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@vps-dc91297d fedora]# wg show\ninterface: wg0\n  public key: (redacted)\n  private key: (hidden)\n  listening port: 51820\n\npeer: c2dz9nLrd7bYfyTFj7fMQHBMkHaIz7GFoH1bRK+ermY=\n  endpoint: 46.205.194.178:60080\n  allowed ips: 10.8.0.3\/32\n  latest handshake: 15 seconds ago\n  transfer: 10.89 MiB received, 3.80 MiB sent\n\npeer: XoOt5kWRfvUSFf8I+SGUHcDcC9TeNloifDspq9uw0BI=\n  endpoint: 185.246.208.88:39392\n  allowed ips: 10.8.0.2\/32\n  latest handshake: 1 minute, 5 seconds ago\n  transfer: 4.07 MiB received, 11.15 MiB sen<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Why? As described in the Privacy Project, I use my own Domain Name Server. It works great in the local network, but I am not able to access it from outside. That&#8217;s why I need my own VPN server. Other possible solutions The VPN server configuration The configuration is simple: The VPN Clients&#8217; configuration The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":9,"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":71,"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/71"}],"wp:attachment":[{"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tomasz-avila.pl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}