How to Install and Configure Public IP via WireGuard on Ubuntu & Debian Linux
You do not need to generate keys or draft wg0.conf from scratch. Open Client Area → My Services → Service Detail, download or copy your pre-configured .conf file, save it to /etc/wireguard/wg0.conf, and bring the tunnel up immediately with sudo wg-quick up wg0.
WireGuard runs natively inside the Linux kernel, providing exceptional speed, low latency, and stability for Ubuntu and Debian servers (Proxmox VMs, Docker hosts, web servers, etc.).
Important: Do not generate a new keypair with wg genkey. Always use the pre-provisioned .conf file (including your PrivateKey, Address, Server PublicKey, and Endpoint) from the Mozfactor Client Area.
Step 1: Install WireGuard & Resolvconf
sudo apt update
sudo apt install -y wireguard resolvconf
Step 2: Create /etc/wireguard/wg0.conf
You can copy the 1-Click Linux Script directly from your Client Area Service Detail page, or create the config manually:
sudo mkdir -p /etc/wireguard
sudo nano /etc/wireguard/wg0.conf
Paste the exact contents of your .conf file from the Client Area:
[Interface]
PrivateKey = <Private_Key_From_Client_Area>
Address = <Assigned_Tunnel_IP>/32
DNS = 8.8.8.8, 1.1.1.1
[Peer]
PublicKey = <Mozfactor_Server_Public_Key>
Endpoint = <Server_Hostname>:<Port>
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
Save with Ctrl + O, Enter, Ctrl + X, then secure file permissions:
sudo chmod 600 /etc/wireguard/wg0.conf
Step 3: Start & Enable on Boot
sudo systemctl enable --now wg-quick@wg0
Step 4: Verify Handshake & Public IP
sudo wg show wg0
curl -4 ifconfig.me
curl -4 ifconfig.me should return your Mozfactor Dedicated Static Public IP. To stop the tunnel temporarily, run sudo wg-quick down wg0.