WireGuard/AmneziaWG interface in Docker + metrics exporter
  • Python 58.6%
  • Shell 28.3%
  • Dockerfile 13.1%
Find a file
MelianMiko 82effe72e3
All checks were successful
Build Docker container / release (push) Successful in 32s
Now it's full wg/awg server
2026-04-16 14:49:20 +07:00
.forgejo/workflows Now it's full wg/awg server 2026-04-16 14:49:20 +07:00
.gitignore Initial upload 2026-04-15 12:53:42 +07:00
amnezia-archive-keyring.gpg Initial upload 2026-04-15 12:53:42 +07:00
compose.yaml Now it's full wg/awg server 2026-04-16 14:49:20 +07:00
Dockerfile Now it's full wg/awg server 2026-04-16 14:49:20 +07:00
entrypoint.sh Now it's full wg/awg server 2026-04-16 14:49:20 +07:00
exporter.py Now it's full wg/awg server 2026-04-16 14:49:20 +07:00
README.md Now it's full wg/awg server 2026-04-16 14:49:20 +07:00

Stupid simple Wiregaurd/Amneziawg setup in Docker with Prometheus exporter

Set up: use following Docker-compose:

services:
  exporter:
    image: code.mmk.pw/owner/dockerguard:latest
    volumes:
      - ./configs:/configs:ro # Folder with Wireguard/AmneziaWG interface config files
  	environment:
      - EXPORTER_ONLY=1       # Optional, if set, will only launch exporter without (a)wg interfaces
      - HTTP_PORT=41337       # Optional, prometheus exporter port, defaults to 41337
      - HTTP_HOST=0.0.0.0     # Optional, prometheus exporter host, defaults to 0.0.0.0
    # -- For network mode
    privileged: true
    # -- For host-network exporter only
    # network_mode: host
    # cap_add:
    #   - NET_ADMIN

Note: to use AmneziaWG, their kernel module should be installed on host.

Named WireGaurd config example:

[Interface]
PrivateKey = XXXX
Address = 10.19.0.1

# Test peer
[Peer]
PublicKey = YYYY
AllowedIPs = 10.19.0.2/32

With this config, Test peer will be used instead of YYYY in metrics.