How to set up a WireGuard Configuration on Linux
Learn how to configure WireGuard on a Linux device using the wg-quick tool.

In an effort to continue expanding our platform support for Guardian Firewall, Guardian's VPN connection can now be configured on Linux devices using the WireGuard protocol. Please follow the steps below to set up a secure tunnel through your Linux device.

1. Install Wireguard CLI tool:


     a. If you are running the Ubuntu OS, run the command: sudo apt install wireguard
     b. Instructions for other distributions can be found here

2. Download the Wireguard config File:

     a. Access Settings: Log in to the Guardian App on your mobile device and tap the gear icon in the upper right corner to access Settings.

     b. Navigate to Share VPN: In the Settings menu, select Advanced > Share VPN Configuration.

     c. Generate VPN Credentials: Choose your preferred region and Transport Protocol, then tap "Generate VPN Credentials."

     d. Share Configuration File: Tap the "Untitled" file (you can rename it if desired) to open it, then select the share option to share the new VPN configuration file to a folder or drive that can be accessed by the Linux machine

3. Move the downloaded .conf configuration file to the /etc/wireguard/ directory.

sudo mv [wgfile.conf] /etc/wireguard

4. To enable the VPN, run the command:

sudo wg-quick up [wgfile]

5. To disable the VPN, run the command:

sudo wg-quick down [wgfile]

Autostart WireGuard in Linux:
To start the WireGuard configuration automaticatlly use the following commands:
  1. Set up WireGuard configuration
  2. Add the WireGuard service to systemd
    a. sudo systemctl enable wg-quick@[configuration name].service
    b. sudo systemctl daemon-reload
  3. Start the new service
    a. sudo systemctl start wg-quick@[configuration name]
  4. Reboot and verify
    Use the command: ip -a in the terminal or a website like ipinfo.io to verify your device’s IP address.  
To disable Autostart:

If you wish to disable autostart for the VPN, use the following commands: 

Sudo systemctl stop wg-quick@[configuration name]

Sudo systemctl disable wg-quick@[configuration name].service

Sudo rm -i /etc/systemd/system/wg-quick@[configuration name]

Sudo systemctl daemon-reload

Sudo systemctl reset-failed

Additional related articles:

Step by step instructions to activate your current subscription on Guardian for macOS.

Learn which platforms and subscription options are available for Guardian Firewall