en:vps:jak-zainstalowac-wireguard-nat

Tłumaczenie jest starsze niż oryginalna strona i może być przestarzałe. Zobacz co się zmieniło.

Guide compatible with LXC VPS (NAT)

How to install WireGuard on an LXC NAT VPS?

First, connect to the server via SSH.

1. First, update the package manager by entering the following commands (this may take a moment):

apt-get update && apt-get upgrade


2. Create a ‘clients’ folder, where we will store our clients’ configuration files, and navigate to it:

mkdir -p /home/wireguard && cd /home/wireguard


3. Run the command that will download the installation script and execute it directly:

wget -4 https://git.io/wireguard -O /home/wireguard/wireguard-install.sh && bash wireguard-install.sh

Installer options:

  1. This server is behind NAT. What is the public IPv4 address or hostname?
    The primary IPv4 address will be detected automatically and will be displayed in square brackets; press Enter to continue
  2. What port should WireGuard listen to?
    You can find a list of available ports assigned to your server in the VPS control panel by going to the Network tab.
    Select the first one on the list that supports UDP or is not already in use by another application on your server.
  3. Enter a name for the first client
    Enter your preferred name for the device you’ll be using to connect to WireGuard
  4. Select a DNS server for the client
    We recommend selecting 1, as it has DNS optimisation for the server
  5. Should automatic updates be enabled for it?
    Select Y (you will receive updates automatically)
The installation is complete. A QR code will be displayed, which you can scan – for example, using your mobile phone – to connect automatically (requires the WireGuard mobile app), or you can use the generated configuration file, which will be located in /home/wireguard/clients
  • en/vps/jak-zainstalowac-wireguard-nat.txt
  • ostatnio zmienione: 11/10/2026 00:06
  • przez reconv