HUB
Sign inSign up
wireguard logo

dgcosenza/wireguard

By dgcosenza

•Updated about 9 hours ago

Hardened source-built WireGuard VPN (tools + wireguard-go) on Debian 13, multi-arch, 0 fixable CVEs.

Image
0

633

dgcosenza/wireguard repository overview

⁠WireGuard — Hardened Debian 13 (trixie-slim) VPN Server & Client

Daily CI OpenSSF Scorecard Workflow Gitleaks Secret Scan Public Content Check OpenSSF Scorecard OpenSSF Best Practices

Trivy + Grype: 0 Fixable CVEs Signed: Cosign OIDC SLSA Build L3 SBOM: SPDX + CycloneDX Base OS Architectures Healthcheck: CI Verified Renovate Enabled Dependabot Enabled Daily Rebuilds

Latest Release Release Date Last Commit Docker Pulls Docker Image Size Registries: Docker Hub + GHCR Packaging License: MIT Upstream License GitHub Issues FNX Labs Catalog

A hardened, source-built multi-arch WireGuard VPN server and client container on Debian 13 (trixie-slim), combining official WireGuard/wireguard-tools and a Go-patched WireGuard/wireguard-go userspace fallback — maintained by Daniel G. Cosenza from FNX Labs.

⁠Overview

dgcosenza/wireguard is a drop-in replacement for lscr.io/linuxserver/wireguard supporting both server mode (automatic key/PSK/peer config and QR code generation under /config) and client mode (mounting pre-existing /config/wg_confs/*.conf). It uses the native Linux kernel WireGuard module automatically whenever present and falls back transparently to a source-built, Go-patched wireguard-go binary in unprivileged or kernel-module-less environments.

⁠Current Versions

ComponentResolved Version
wireguard-tools1.0.20260223
Go toolchain1.27.4
Base OSDebian 13.8 (trixie-slim)
Architectureslinux/amd64, linux/arm64
Uncompressed size (per arch)amd64: 39.5 MB, arm64: 134.9 MB
Last verified build (UTC)2026-11-28
Published multi-arch digestdgcosenza/wireguard@sha256:585352c5a3fdf2422a84e4ad308a56dbebd2f18976a846e5461cace279fec82c
GHCR mirrorghcr.io/dgcosenza/wireguard@sha256:585352c5a3fdf2422a84e4ad308a56dbebd2f18976a846e5461cace279fec82c
Supply chainCosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance
Security gate (Trivy + Grype on SBOM)0 fixable findings of any severity (13 upstream-unfixed)

⁠Supported Tags

TagPolicyDescription
latestMovingLatest verified multi-arch build passing all CVE, Dive, and live-tunnel smoke gates.
<version> (e.g. 1.0.20260223)MovingLatest verified build for that wireguard-tools release.
<version>-<YYYYMMDD>ImmutableDate-stamped daily security rebuild.
sha-<short>ImmutableGit commit tag from this repository.

⁠Supported Architectures

ArchitectureStatusVerification
linux/amd64Published & natively testedLive wg0 tunnel bring-up, peer config + QR generation, Dive >= 95%, Trivy + Grype 0 fixable CVEs, Cosign OIDC, SLSA L3.
linux/arm64Published & natively testedLive wg0 tunnel bring-up, peer config + QR generation, Dive >= 95%, Trivy + Grype 0 fixable CVEs, Cosign OIDC, SLSA L3.

⁠Quick Start

Volume ownership note: docker-compose.example.yml defaults to a named Docker volume so non-root runtime permissions (1000:1000) are initialized automatically; if switching to a host bind mount, pre-create the directory owned by 1000:1000 (mkdir -p ./data && chown 1000:1000 ./data) before docker compose up -d.

docker run -d --name wireguard --restart unless-stopped \
  --cap-drop ALL --cap-add NET_ADMIN --cap-add SYS_MODULE \
  --device /dev/net/tun:/dev/net/tun \
  --sysctl net.ipv4.conf.all.src_valid_mark=1 --sysctl net.ipv4.ip_forward=1 \
  -p 51820:51820/udp -v "$(pwd)/config:/config" \
  -e SERVERURL="vpn.example.test" -e PEERS="laptop,phone" -e LOG_CONFS="false" \
  dgcosenza/wireguard:latest

⁠Compose Example

See docker-compose.example.yml⁠.

⁠Configuration

VariableDefaultDescription
SERVERURL(empty)External hostname/IP for server mode. Leave unset for client mode (/config/wg_confs/*.conf).
SERVERPORT51820UDP listening port.
PEERS1Peer count (3) or comma-separated peer names (laptop,phone).
PEERDNS1.1.1.1DNS server pushed to peers (auto uses tunnel gateway .1).
INTERNAL_SUBNET172.20.13.0Internal /24 VPN subnet.
ALLOWEDIPS0.0.0.0/0, ::/0Peer AllowedIPs routing policy.
PERSISTENTKEEPALIVE_PEERS(empty)all or comma-separated peer names to enable PersistentKeepalive = 25.
LOG_CONFStruePrint ASCII QR codes to stdout on generation (false recommended in production).
TZEtc/UTCContainer timezone.

Ports: 51820/udp. Volumes: /config (keys, wg_confs/*.conf, peer_*/*.{conf,png}). Privileges: Requires NET_ADMIN (and /dev/net/tun for userspace fallback) to manage network interfaces and iptables/nftables NAT rules. PID 1: tini.

⁠Healthcheck

HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
  CMD ["/usr/local/bin/wireguard-healthcheck"]

Probes wg show <iface> public-key for every configured WireGuard interface. Tested live on both amd64 and arm64; do not disable in Compose.

⁠Upgrade / Migration from linuxserver/wireguard

  1. Back up /config (wg_confs/, server/, peer_*/).
  2. Switch the image to dgcosenza/wireguard@sha256:<digest> keeping existing /config mounted — existing /config/wg_confs/wg0.conf is preserved and brought up automatically.

⁠Supply-Chain Verification

cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/wireguard-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/wireguard:latest

gh attestation verify oci://ghcr.io/dgcosenza/wireguard:latest --owner dgcosenza

⁠Security

  • 0 fixable vulnerabilities of any severity: Hard-gated by Trivy (UNKNOWN–CRITICAL, --ignore-unfixed, exit 1) and Grype on Syft SPDX SBOM (--only-fixed --fail-on negligible) on both amd64 and arm64.
  • Strict key permissions: All generated private/preshared keys and configs are written with umask 077 (0600).
  • Patched Go modules: wireguard-go is compiled with current Go LTS and updated golang.org/x/{crypto,net,sys} modules.
  • Report issues via SECURITY.md⁠.

⁠Build Locally

docker buildx build --platform linux/amd64 --load -t dgcosenza/wireguard:local .
./tests/smoke.sh dgcosenza/wireguard:local

⁠Update Policy

.github/workflows/daily.yml⁠ runs daily at 05:19 UTC with --no-cache: resolves latest WireGuard/wireguard-tools tag, Go toolchain, and debian:13.8-slim digest; runs live wg0 smoke + Dive + Trivy + Grype gates on amd64 and arm64; publishes identical Cosign-signed SLSA L3 digests to Docker Hub and GHCR (plus optional secondary OCI mirrors); syncs docs & Hub overview; and manages a single ci-failure issue.

⁠Design Decisions

  • Native kernel first, wireguard-go fallback: Zero performance overhead on hosts with kernel WireGuard while still working seamlessly in userspace and CI verification.
  • No compilers in runtime: golang and build-essential remain strictly in builder stages.

⁠License

  • Packaging, scripts, workflows, and documentation (packaging: MIT): MIT License⁠ — copyright Daniel G. Cosenza from FNX Labs.
  • Upstream WireGuard/wireguard-tools (upstream: GPL-2.0-only): GPL-2.0⁠. WireGuard/wireguard-go is MIT. See THIRD-PARTY-NOTICES.md⁠.

⁠Credits

Maintained by Daniel G. Cosenza from FNX Labs. Built from official WireGuard⁠ sources.

Tag summary

Content type

Image

Digest

sha256:585352c5a…

Size

37.6 MB

Last updated

about 9 hours ago

docker pull dgcosenza/wireguard