Embedding WireGuard in Custom Applications

The WireGuard Project's client applications have been designed with maximum reusability in mind, such that it is possible to create custom applications that use WireGuard. The story is slightly different on different platforms, and this page attempts to summarize what the project has available.

If you're a sysadmin simply trying to script existing WireGuard clients, this page is not for you. Instead, check out documentation of the wg(8) and wg-quick(8) tools in addition to the Windows enterprise management guide.

Windows: embeddable-dll-service

The embeddable-dll-service code and documentation lets consumers of the library create full standalone Windows services that embed WireGuard.

Windows: WireGuardNT

The WireGuardNT project provides a much lower level way of embedding WireGuard than the embeddable-dll-service. It is highly recommended to use the embeddable-dll-service rather than WireGuardNT directly, as the former utilizes the latter inside.

macOS & iOS: WireGuardKit

Both macOS and iOS provide WireGuardKit from the same repository, allowing for easy integration using Swift PM.

Android: com.wireguard.android:tunnel

Android provides the com.wireguard.android:tunnel library on Maven Central with extensive class documentation and a blurb for gradle.

Linux: embeddable-wg-library

The wireguard-tools package contains a single-file C library for use interacting with the kernel.

Linux/BSD/Darwin: wgctrl-go

The wgctrl-go project allows creating and manipulating WireGuard configurations from Go.

Linux: NetworkManager, Systemd, connmann

NetworkManager, Systemd, and connman each have full WireGuard support, which can be manipulated using their respective dbus APIs.