How to Import a WireGuard VPN Using Network Manager (Manjaro, Ubuntu, etc.)

This tutorial walks you through importing a WireGuard VPN configuration using Network Manager on Linux distributions like Manjaro and Ubuntu. Includes step-by-step instructions with both GUI and CLI options.

TL;DR

  • Install network-manager-wireguard.
  • Use GUI (Network Settings) or nmcli to import .conf files.
  • Enable and connect in one click from your system tray.
  • Works across Manjaro, Ubuntu, Fedora, and more.

Introduction

WireGuard is one of the fastest, simplest, and most secure VPN solutions out there. While many people configure it via terminal, Network Manager makes it dead easy to manage VPN connections graphically on popular distros like Manjaro, Ubuntu, and Fedora.

This guide shows you how to import a WireGuard VPN configuration file (.conf) using Network Manager—via GUI and CLI—making it user-friendly for both beginners and power users.


Prerequisites

  • A Linux system (tested on Manjaro, Ubuntu, Fedora)
  • A WireGuard .conf file (typically provided by your VPN service or server)
  • Internet connection
  • vim for any edits (optional but recommended)

Step 1️⃣: Install Network Manager WireGuard Plugin

Manjaro / Arch:

sudo pacman -Syu networkmanager wireguard-tools networkmanager-wireguard

Ubuntu / Debian:

sudo apt update
sudo apt install network-manager wireguard wireguard-tools network-manager-wireguard-gnome

Fedora:

sudo dnf install NetworkManager-wireguard wireguard-tools

📝 What this does:

  • network-manager-wireguard adds WireGuard support to your Network Manager.
  • wireguard-tools includes the wg command-line utility.

Verify:

nmcli connection show --active | grep wireguard

If no output yet, that's expected—we haven't imported yet.


Step 2️⃣: Import WireGuard Config via GUI

  1. Open Settings:
    • Manjaro: Settings → Network → VPN
    • Ubuntu: Settings → Network → VPN
  2. Add a VPN:
    • Click "+" (Add)
    • Choose "Import from file…"
    • Select your .conf file (e.g., wg0.conf)
  3. Save & Connect:
    • Give it a friendly name if you want.
    • Toggle the VPN ON to connect.

🛠 Pro tip: If you're importing a config with multiple peers, ensure you're importing the correct peer config for your machine.


Step 3️⃣: Import WireGuard Config via CLI (nmcli)

For those who prefer the command line:

nmcli connection import type wireguard file /path/to/your/wg0.conf

Example:

nmcli connection import type wireguard file ~/vpn-configs/myvpn.conf

Activate it:

nmcli connection up myvpn

Deactivate:

nmcli connection down myvpn

🛠 Check status:

nmcli connection show --active

Step 4️⃣: Auto-connect on Boot (Optional)

To ensure your VPN starts on boot:

nmcli connection modify myvpn connection.autoconnect yes

Bonus: Edit Config via vim

Need to tweak your config (e.g., DNS, AllowedIPs)?

vim /etc/NetworkManager/system-connections/myvpn.nmconnection

Make your changes, save with :wq, and then reload:

nmcli connection reload

Troubleshooting

Issue: DNS leaks
Fix: Set DNS manually in your WireGuard config:

[Interface]
DNS = 1.1.1.1

Issue: Cannot connect, "Permission Denied"
Fix: Check file permissions; config files need to be readable by root:

sudo chmod 600 /path/to/your/wg0.conf

Issue: VPN not showing in the GUI after import
Fix: Restart Network Manager:

sudo systemctl restart NetworkManager

Conclusion

Now you have a fully working WireGuard VPN imported into Network Manager, making connection management super easy. Whether you're a GUI fan or a terminal warrior, this setup lets you manage VPNs with minimal hassle.


References