WireGuard on Ubuntu / Debian CLI
WireGuard® is a modern VPN protocol for secure and fast data transfer over the internet.
Before installation, make sure that:
• This guide demonstrates the setup process on Ubuntu 24.04 and Debian 12 without a GUI. On earlier versions, some steps may differ, while on newer versions they typically remain the same.
• You have a WireGuard configuration file in .conf format from your Personal Area (in our example, the configuration file Lithuania.conf will be used).
1. Update the package list and install WireGuard:
sudo apt updatesudo apt install -y wireguard openresolv2. Create a directory for WireGuard configurations (if it doesn’t already exist):
sudo mkdir -p /etc/wireguard3. Copy your .conf file into this directory:
sudo cp ~/Downloads/Lithuania.conf /etc/wireguard/4. WireGuard requires that the configuration file be owned by root and have restricted permissions:
sudo chmod 600 /etc/wireguard/Lithuania.conf5. To connect, run:
sudo wg-quick up LithuaniaTo disconnect the VPN, run:
sudo wg-quick down Lithuania