{"id":109,"date":"2025-05-23T16:11:45","date_gmt":"2025-05-23T14:11:45","guid":{"rendered":"https:\/\/netcloud24.com\/pl\/blog\/?p=109"},"modified":"2025-05-23T16:12:01","modified_gmt":"2025-05-23T14:12:01","slug":"jak-zainstalowac-wireguard-vpn-na-debian-12","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/pl\/blog\/jak-zainstalowac-wireguard-vpn-na-debian-12\/","title":{"rendered":"Jak zainstalowa\u0107 WireGuard VPN na Debian 12\u00a0"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><strong>WireGuard<\/strong> to nowoczesna, szybka i bezpieczna implementacja VPN, kt\u00f3ra zast\u0119puje starsze protoko\u0142y takie jak OpenVPN czy IPSec. W tym poradniku poka\u017cemy Ci krok po kroku, jak zainstalowa\u0107 i skonfigurowa\u0107 WireGuard na serwerze Debian 12.<\/p>\n<h2>Wymagania wst\u0119pne<\/h2>\n<ul>\n<li>Serwer z Debian 12 z uprawnieniami <code>sudo<\/code><\/li>\n<li>Publiczny adres IP lub domena<\/li>\n<li>Klient WireGuard (np. Linux, Windows, macOS, Android, iOS)<\/li>\n<\/ul>\n<h2>Krok 1: Instalacja WireGuard<\/h2>\n<pre><code>sudo apt update\r\nsudo apt install -y wireguard<\/code><\/pre>\n<h2>Krok 2: Wygenerowanie kluczy<\/h2>\n<p>Na serwerze utw\u00f3rz katalog i wygeneruj klucz prywatny i publiczny:<\/p>\n<pre><code>sudo mkdir -p \/etc\/wireguard\r\ncd \/etc\/wireguard\r\nsudo wg genkey | tee server_private.key | wg pubkey | tee server_public.key<\/code><\/pre>\n<h2>Krok 3: Konfiguracja interfejsu serwera<\/h2>\n<p>Utw\u00f3rz plik <code>\/etc\/wireguard\/wg0.conf<\/code> z zawarto\u015bci\u0105:<\/p>\n<pre><code>[Interface]\r\nAddress = 10.0.0.1\/24\r\nListenPort = 51820\r\nPrivateKey = &lt;zawarto\u015b\u0107 pliku server_private.key&gt;\r\n\r\n# Przyk\u0142adowy peer (klient)\r\n[Peer]\r\n# klient1\r\nPublicKey = \r\nAllowedIPs = 10.0.0.2\/32\r\n<\/code><\/pre>\n<h2>Krok 4: W\u0142\u0105czenie IP forwarding<\/h2>\n<pre><code>sudo nano \/etc\/sysctl.conf\r\n# odkomentuj lub dodaj:\r\nnet.ipv4.ip_forward=1\r\n\r\nsudo sysctl -p<\/code><\/pre>\n<h2>Krok 5: Regu\u0142y firewalla (iptables)<\/h2>\n<pre><code>sudo apt install -y iptables\r\nsudo iptables -A FORWARD -i wg0 -j ACCEPT\r\nsudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\r\nsudo apt install -y iptables-persistent\r\n# zapisz regu\u0142y przy instalacji iptables-persistent<\/code><\/pre>\n<h2>Krok 6: Uruchomienie i autostart WireGuard<\/h2>\n<pre><code>sudo systemctl enable wg-quick@wg0\r\nsudo systemctl start wg-quick@wg0\r\nsudo wg show<\/code><\/pre>\n<h2>Krok 7: Konfiguracja klienta<\/h2>\n<p>Na kliencie zainstaluj WireGuard i utw\u00f3rz plik konfiguracyjny <code>client.conf<\/code>:<\/p>\n<pre><code>[Interface]\r\nPrivateKey = \r\nAddress = 10.0.0.2\/24\r\nDNS = 1.1.1.1\r\n\r\n[Peer]\r\nPublicKey = \r\nEndpoint = twojaserwer.domena.pl:51820\r\nAllowedIPs = 0.0.0.0\/0<\/code><\/pre>\n<p>Uruchom na kliencie:<\/p>\n<pre><code>sudo wg-quick up client<\/code><\/pre>\n<h2>Dlaczego warto wybra\u0107 Netcloud24?<\/h2>\n<p>Dla stabilnej i szybkiej pracy VPN polecamy us\u0142ugi <a href=\"https:\/\/netcloud24.com\/\" target=\"_blank\" rel=\"noopener\"><strong>VPS Windows<\/strong><\/a> oraz <strong>serwery dedykowane<\/strong> od Netcloud24. Gwarantujemy:<\/p>\n<ul>\n<li>Dedykowane zasoby CPU i RAM<\/li>\n<li>Szybkie dyski SSD NVMe<\/li>\n<li>Wysok\u0105 dost\u0119pno\u015b\u0107 i niskie op\u00f3\u017anienia<\/li>\n<li>Wsparcie techniczne 24\/7<\/li>\n<\/ul>\n<h2>Podsumowanie<\/h2>\n<p>WireGuard to nowoczesna i lekka implementacja VPN, idealna dla wymagaj\u0105cych u\u017cytkownik\u00f3w. Dzi\u0119ki temu przewodnikowi uruchomisz bezpieczny VPN na Debian 12 w kilka minut, a infrastruktura Netcloud24 zapewni mu niezawodno\u015b\u0107.<\/p>\n<p>Sprawd\u017a ofert\u0119 serwer\u00f3w: <a href=\"https:\/\/netcloud24.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/netcloud24.com\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; WireGuard to nowoczesna, szybka i bezpieczna implementacja VPN, kt\u00f3ra zast\u0119puje starsze protoko\u0142y takie jak OpenVPN czy IPSec. W tym poradniku poka\u017cemy Ci krok po\u2026<\/p>\n","protected":false},"author":1,"featured_media":110,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":1,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions\/111"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/media\/110"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}