Installation

Windows [7, 8, 8.1, 10, 2012, 2016, 2019]

WireGuard for Windows is available from this site:

Download for 64-bit
Download for 32-bit

macOS [app store]

Download from App Store

Ubuntu [module & tools]

$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard

Android [play store & f-droid]

Download from Play Store
Download from F-Droid

iOS [app store]

Download from App Store

Debian [module, tools]

# echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
# printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
# apt update
# apt install wireguard

Fedora [module & tools]

$ sudo dnf copr enable jdoss/wireguard
$ sudo dnf install wireguard-dkms wireguard-tools

Red Hat Enterprise Linux / CentOS [module & tools]

$ yum update -y
$ reboot # unless there were no updates
$ sudo curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo
$ sudo yum install epel-release
$ sudo yum install wireguard-dkms wireguard-tools

Mageia [module, tools]

$ sudo urpmi wireguard-tools

The kernel module is already part of the default kernel.

Arch [module, tools]

$ sudo pacman -S wireguard-tools wireguard-arch

Instead of wireguard-arch, one may choose wireguard-lts or wireguard-dkms+linux-headers, depending on which kernel is used.

OpenSUSE [module & tools]

$ sudo zypper addrepo -f obs://network:vpn:wireguard wireguard
$ sudo zypper install wireguard-kmp-default wireguard-tools

Slackware [module & tools]

$ wget https://slackbuilds.org/slackbuilds/14.2/network/WireGuard.tar.gz && tar xzf WireGuard.tar.gz
$ cd WireGuard && OUTPUT=$(pwd) ./WireGuard.SlackBuild && sudo installpkg ./WireGuard-*.tgz

Alpine [module & tools]

# apk add -U wireguard-tools

You'll likely need to be on the edge repositories first, running a kernel from edge as well.

Gentoo [module & tools]

# emerge wireguard

Exherbo [module & tools]

# cave resolve -x wireguard

NixOS [module & tools]

boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
environment.systemPackages = [ pkgs.wireguard pkgs.wireguard-tools ];

Nix on Darwin [userspace go & tools]

$ nix-env -iA nixpkgs.wireguard-tools

OpenWRT [module & tools]

# opkg install wireguard

Further installation and configuration instructions may be found on the wiki.

FreeBSD [userspace go & tools]

# pkg install wireguard

OpenBSD [userspace go & tools]

For OpenBSD 6.6, there are packages:

# pkg_add wireguard-go wireguard-tools

For prior versions, you can use this script to download, compile, and install the tools and userspace implementation. You are advised to run this script in a more reasonable way than piping ftp to sh.

# ftp -o - https://xn--4db.cc/IKuBc62Z | sh

Void [module & tools]

# xbps-install -S wireguard

Adélie Linux [module, tools]

# apk add wireguard-tools wireguard-module

Source Mage [module & tools]

# cast wireguard

Buildroot [module & tools]

BR2_PACKAGE_WIREGUARD=y

EdgeOS [module & tools]

$ sudo dpkg -i wireguard-{octeon|ralink}-{version}.deb

First download the correct pre-built file from the release page, and then install it with dpkg as above.

LinuxKit [module & tools]

kernel:
  linuxkit/kernel:...
image:
  linuxkit/ip:...

AstLinux [module & tools]

BR2_PACKAGE_WIREGUARD=y

Milis [module, tools]

# mps kur wireguard-kernel
# mps kur wireguard-tools

macOS Homebrew and MacPorts – Basic CLI [homebrew userspace go & homebrew tools] & [macports userspace go & macports tools]

$ brew install wireguard-tools

or

$ port install wireguard-tools

See the cross-platform documentation for more information.


Move on to the quick start walkthrough. Or, if your distribution isn't listed above, you may easily compile from source instead, a fairly simple procedure.

Compiling the Kernel Module from Source

You will need gcc ≥4.7, your kernel headers in the right location for compilation, as well as libmnl for building the userspace wg(8) utility.

Step 1: Install the toolchain

Ubuntu and Debian
$ sudo apt-get install libmnl-dev libelf-dev linux-headers-$(uname -r) build-essential pkg-config
Fedora
$ sudo dnf install libmnl-devel elfutils-libelf-devel kernel-devel pkg-config @development-tools
Arch
# pacman -S libmnl linux-headers base-devel pkg-config
Gentoo
# emerge libmnl
OpenSUSE
$ sudo zypper install kernel-default-devel libmnl-devel pkg-config
Alpine
# apk add build-base linux-hardened-dev libmnl-dev  # or linux-vanilla-dev on a vanilla kernel

Step 2: Grab the code

Either download the latest snapshot (recommended):

$ wget https://git.zx2c4.com/WireGuard/snapshot/WireGuard-.tar.xz

Or clone the git repository (unstable):

$ git clone https://git.zx2c4.com/WireGuard

Step 3: Compile the module and the wg(8) tool

$ cd WireGuard/src
$ make

(You may instead run make debug if you'd like to have additional information on what's happening in your dmesg(1).)

Step 4: As root, install it

# make install

Move on to the quick start walkthrough.

Kernel Requirements

WireGuard requires Linux ≥3.10, with the following configuration options, which are likely already configured in your kernel, especially if you're installing via distribution packages, above.

Some, but not all, of these options directly correspond to menuconfig entries. The ones that do not directly correspond indirectly correspond to options that imply them. For enabling the above options, select these items in menuconfig:

[*] Networking support -->
    Networking options -->
        [*] TCP/IP networking
        [*]   IP: Foo (IP protocols) over UDP
[*] Cryptographic API -->
    [*] Cryptographic algorithm manager

When building as an out of tree module, it is probable that one needs CONFIG_UNUSED_SYMBOLS set as well.

Building Directly In-Tree

Rather than building as an external module, if you would like to build WireGuard as a module or as built-in, directly from within the kernel tree, you may use the create-patch.sh script which creates a patch for adding WireGuard directly to the tree or the jury-rig.sh script which links the WireGuard source directory into the kernel tree:

$ cd /usr/src/linux
$ ~/wireguard/contrib/kernel-tree/create-patch.sh | patch -p1

    or

$ ~/wireguard/contrib/kernel-tree/jury-rig.sh /usr/src/linux

Then you will be able to configure these options directly:

These are selectable easily via menuconfig, if CONFIG_NET and CONFIG_INET are also selected:

[*] Networking support -->
    Networking options -->
        [*] TCP/IP networking
        [*]   IP: WireGuard secure network tunnel
        [ ]     Debugging checks and verbose messages