WireGuard on Ubuntu & Debian CLI

WireGuard® is a modern VPN protocol for secure and fast data transfer over the internet.

It is recommended to use this protocol if your Internet provider does not restrict VPN protocols or services.

If there are any restrictions or connection issues, please use the VLESS (XTLS) protocol via v2rayN or AmneziaWG 2 via our guide.

Before installation, make sure that:

• You are using Ubuntu 24.04 or Debian 12 without a GUI. On earlier versions, some steps may differ, while on newer versions they generally 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 update
sudo apt install -y wireguard openresolv

2. Create a directory for WireGuard configurations (if it doesn’t already exist):

sudo mkdir -p /etc/wireguard

3. 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.conf

5. To connect, run:

sudo wg-quick up Lithuania

To disconnect the VPN, run:

sudo wg-quick down Lithuania