WireGuard icon

WireGuard

Modern, high-performance VPN with minimal attack surface

WireGuard illustration

What is this?

WireGuard is a modern VPN that uses state-of-the-art cryptography and has a much smaller codebase than traditional VPNs. It connects in milliseconds instead of seconds, which matters when edge devices reboot or switch between cellular and wired networks.

The container ships the WireGuard userspace tools only — the actual encryption runs inside the Linux kernel on your device, making it extremely fast even on resource-constrained hardware.

Important: This application requires CAP_NET_ADMIN capability and is not fully rootless. The host kernel must have the wireguard module loaded (Linux ≥ 5.6). The container ships tools only, not the kernel module. Verify your BeldenOS kernel configuration includes WireGuard support.

Example: how a factory uses it

A water treatment plant has three remote pump stations connected over cellular modems. Each station runs a WireGuard container on its edge gateway. The tunnels reconnect automatically when cellular service drops and restores — often in under a second. The central SCADA system sees all pump PLCs on one flat network, even though they’re spread across 50 km of countryside on intermittent cellular links.

Network Topology

graph LR
    subgraph Remote Pump Stations
        P1[Pump Station 1
cellular modem] P2[Pump Station 2
cellular modem] end subgraph Cellular WAN CELL{UDP :51820
reconnects in ms} end subgraph SCADA Edge Gateway WG[WireGuard Server
10.89.3.2
tunnel: 192.168.3.0/24] SCADA[SCADA + PLCs] end P1 -->|UDP :51820| CELL P2 -->|UDP :51820| CELL CELL --> WG WG -->|flat network| SCADA

Requires: CAP_NET_ADMIN + host kernel wireguard module (Linux ≥ 5.6). This application is NOT fully rootless. The container ships userspace tools only.

Import this app

Paste this into your Margo manager to import the app:

public.ecr.aws/g2n4p2m7/belden-margo:1.2.1_vpn-wireguard-margo-manifest

Run: oras pull public.ecr.aws/g2n4p2m7/belden-margo:1.2.1_vpn-wireguard-margo-manifest

Technical details

Deployment Profiles

  • PROPOSED — quadlet (WG-PROPOSAL-02)

    Systemd-native deployment. Requires CAP_NET_ADMIN capability. Host kernel must have wireguard module (Linux ≥ 5.6). Designed for edge devices running systemd and Podman ≥ 4.4.

Application Description (margo.yaml)

apiVersion: margo.org/v1alpha1
kind: ApplicationDescription
id: com-belden-vpn-wireguard
metadata:
  name: "WireGuard"
  version: 1.2.0+vpn-wireguard-margo-manifest
  description: Modern, high-performance VPN with minimal attack surface. Requires CAP_NET_ADMIN — not fully rootless. The container ships WireGuard userspace tools only; the host kernel must have the wireguard module loaded (Linux ≥ 5.6). Verify your BeldenOS kernel configuration includes WireGuard support before deploying.
  catalog:
    application:
      descriptionFile: "README.md"
      tagline: "Modern, high-performance VPN with minimal attack surface"
      tags:
        - "vpn"
        - "wireguard"
        - "networking"
        - "security"
        - "edge-computing"
        - "industrial"
    organization:
      - name: "Belden Inc."
        site: "https://www.belden.com"

deploymentProfiles:
  - id: "quadlet-v1"
    type: "quadlet"
    description: >-
      Systemd-native deployment. Requires CAP_NET_ADMIN capability.
      Host kernel must have wireguard module (Linux ≥ 5.6). Designed for
      edge devices running systemd and Podman ≥ 4.4.
    requiredResources:
      cpu:
        cores: 0.1
        architectures:
          - amd64
          - arm64
      memory: "64Mi"
      storage: "128Mi"
      interfaces:
        - type: ethernet
    components:
      - name: "wireguard-quadlet"
        properties:
          repository: oci://public.ecr.aws/g2n4p2m7/belden-margo
          revision: 1.2.0_vpn-wireguard-quadlet
          wait: true
          timeout: "5m0s"

parameters:
  # VPN Keys Config
  serverPrivateKey:
    value: "gF5PrO5g4Ha5FXnzZifJz4nXNeoI+29aJcnE1IgXBmw="
    targets:
      - pointer: "WG_SERVER_PRIV"
        components:
          - wireguard-quadlet
  peerPublicKey:
    value: "r+x1m5ZhkrIggYSKywtpq0eqMRknkvsjO5Iy5K/Rtxo="
    targets:
      - pointer: "WG_PEER_PUB"
        components:
          - wireguard-quadlet
  presharedKey:
    value: "X838V4fZEkAU6ohJp1/pK8lAcURoxEG/wmaCoTXzqtI="
    targets:
      - pointer: "WG_PSK"
        components:
          - wireguard-quadlet

  # VPN Network Config
  serverAddr:
    value: "192.168.3.1/24"
    targets:
      - pointer: "WG_SERVER_ADDR"
        components:
          - wireguard-quadlet
  listenPort:
    value: 51820
    targets:
      - pointer: "WG_LISTEN_PORT"
        components:
          - wireguard-quadlet
  peerAllowedIPs:
    value: "192.168.3.2/32"
    targets:
      - pointer: "WG_PEER_ALLOWED_IPS"
        components:
          - wireguard-quadlet

configuration:
  sections:
    - name: "VPN Keys"
      settings:
        - parameter: serverPrivateKey
          name: "Server Private Key"
          immutable: false
          schema: wgKeySchema
        - parameter: peerPublicKey
          name: "Peer Public Key"
          immutable: false
          schema: wgKeySchema
        - parameter: presharedKey
          name: "Preshared Key"
          immutable: false
          schema: wgKeySchema

    - name: "Network"
      settings:
        - parameter: serverAddr
          name: "Server Tunnel Address"
          immutable: false
          schema: cidrSchema
        - parameter: listenPort
          name: "Listen Port"
          immutable: false
          schema: listenPortSchema
        - parameter: peerAllowedIPs
          name: "Peer Allowed IPs"
          immutable: false
          schema: cidrSchema

  schema:
    - name: wgKeySchema
      dataType: string
      allowEmpty: false

    - name: cidrSchema
      dataType: string
      allowEmpty: false

    - name: listenPortSchema
      dataType: integer
      minValue: 1
      maxValue: 65535
      allowEmpty: false

Podman Quadlet Units

PROPOSED — quadlet (WG-PROPOSAL-02)

wireguard-server.container

[Unit]
Description=WireGuard VPN tunnel
After=network-online.target
Wants=network-online.target

[Container]
ContainerName=wireguard
Image=docker.io/linuxserver/wireguard:1.0.20250521

AddCapability=NET_ADMIN
Sysctl=net.ipv4.ip_forward=1

PublishPort=${WG_LISTEN_PORT}:${WG_LISTEN_PORT}/udp
Volume=${QUADLET_DIR}/wireguard-data/wg0.conf:/config/wg_confs/wg0.conf:ro

StopTimeout=10

[Service]
Restart=on-failure
Environment=QUADLET_DIR=%E/containers/systemd
Environment=WG_LISTEN_PORT=51820
Environment=WG_SERVER_ADDR=192.168.3.1/24
Environment=WG_PEER_ALLOWED_IPS=192.168.3.2/32
EnvironmentFile=-%E/containers/systemd/wireguard.env
ExecStartPre=podman run --rm --name wireguard-pre --env-host --env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -v ${QUADLET_DIR}/wireguard-data:/data docker.io/alpine:3.21 sh -c "apk add gettext-envsubst -q && envsubst < /data/wg0.conf.tmpl > /data/wg0.conf" 

[Install]
WantedBy=default.target

Container Images

Image Reference
docker.io/alpine:3.21
docker.io/linuxserver/wireguard:1.0.20250521

License

GPLv2