gluetun

passtequeMIT活跃维护

把 VPN 客户端塞进轻量 Docker 容器,统一支持多家 VPN 服务商,内置 OpenVPN/WireGuard、DNS over TLS 和代理服务器,方便容器流量安全出网。

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.

v3.41.3发布于 2026-07-30 14:48 UTC16,034star +32 / 7 天646fork同步于 2026-11-10 11:25 UTC

怎么上手

由 README 提炼,执行前请确认
docker run -d --cap-add=NET_ADMIN --device /dev/net/tun -p 8888:8888/tcp -e VPN_SERVICE_PROVIDER=ivpn -e VPN_TYPE=openvpn -e OPENVPN_USER= -e OPENVPN_PASSWORD= qmcgaw/gluetun
硬件要求按 README 说明

README 未说明显存或 GPU 要求;镜像基于 Alpine 3.23,体积 43.1MB,兼容 amd64、i686、ARM 64/32 位 v6/v7 及 ppc64le。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

轻量 Docker 容器里的多供应商 VPN 客户端,让容器流量统一走 VPN

把 VPN 客户端塞进轻量 Docker 容器,统一支持多家 VPN 服务商,内置 OpenVPN/WireGuard、DNS over TLS 和代理服务器,方便容器流量安全出网。

核心能力

  • 支持 20+ 家 VPN 服务商,OpenVPN 全支持
  • WireGuard 支持内核态与用户态两种实现
  • 内置 DNS over TLS 与恶意域名/IP 拦截
  • 内置防火墙 kill switch 只放行 VPN 流量
  • 自带 Shadowsocks、Socks5、HTTP 代理服务器

容易踩的坑

容器必须加 NET_ADMIN 能力并挂载 /dev/net/tun,否则无法建立 VPN;需自行填写对应服务商的账号密码或 WireGuard 私钥;Mullvad 仅支持 WireGuard,部分服务商需用 custom provider 配置 WireGuard。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.41.3
  1. v3.41.3最新正式版2026-07-30 · 2026-07-30 14:48 UTC

    This fixes a VPN server port forwarding deadlock bug introduced whilst back-porting a fix from the master branch (:latest image) to v3.41.2. Credits to @robinostlund for reporting the bug and even nailing down what it was! (#3416)

    Refer to v3.41.2 fixes in case you haven't checked.

  2. v3.41.22026-07-29 · 2026-07-29 11:19 UTC
    查看更新说明

    ⚠️ there is a deadlock bug in the port forwarding if you use the up or down command, I will release v3.41.3 shortly

    Fixes

    • Wireguard:
      • support IPv6 address formatting from config files (#3273)
      • ignore empty address strings
      • skip tun device checks when using kernelspace
    • OpenVPN:
      • bundle provider CA certificates in one block (#3258)
      • trim spaces in config lines before parsing (#3327)
      • fix support for tcp-client
        • always use proto tcp-client when using TCP
        • parses tcp-client (on top of tcp, tcp4, tcp6) as meaning TCP
    • Custom openvpn: restrict custom openvpn config protocol to tcp or udp internally
    • Firewall: shared mutex for both iptables and ip6tables to prevent race conditions
    • Healthcheck:
      • correct behavior when HEALTH_RESTART_VPN=off and startup check fails
      • prevent race condition on the healthchecker (#3400)
    • DNS:
      • skip blocking if block lists download fails
      • correct error wrapping for DNS listening address validation
      • DNS over TLS pool behavior fixed
        • handle timed out connections the same as closed connections
        • close connection on TLS handshake failure
        • improve mutex handling during connection renewal and retrieval
    • VPN port forwarding:
      • no longer stuck after failed port forwarding
      • handle empty ports without panicing
    • Updater: only uses DoH to cloudflare+google
      • prevent dns plaintext manipulation both the periodic update and when running in cli mode
      • possibly higher reliability on poor connections versus UDP
      • drop -dns flag in update command
      • for now no configuration allowed since it makes everything rather complex
    • Control server:
      • use port and ports for both single port and multiple ports forwarded
      • authentication: return 404 or 405 depending on route
    • Increase global http client timeout to 35s and precise lower timeouts where needed
      • Fix DNS blocklists slow downloads
      • Leave 35s timeout for updaters
      • Set timeouts to 1s for local calls
      • Set timeouts to 5s for LAN VPN calls and small external calls
      • Set timeouts to 10s external VPN API calls
    • Kernel modules: probe searches for features built-in the kernel
    • CI: set hash of PR commit instead of synthetic commit in docker build argument
    • internal/command: fix rare race condition on log line stream at command completion

    Provider specific fixes

    • AirVPN: update servers data (#3186)
    • ExpressVPN:
      • add new CA3 certificate to fix TLS handshake failure (#3184, #3192)
      • remove pakistan server
    • Privado:
      • servers data updated using JSON API
      • allow OpenVPN TCP protocol
      • allow additional OpenVPN ports 443, 8080 and 8443 for both tcp and udp
    • Private Internet Access:
      • remove none encryption preset
      • use AES-GCM for all presets
      • allow ports 501 and 502 as custom ports given they are the defaults
      • try x.y.128.1 and x.y.0.1 from the gateway IP to find the API IP address
      • fix servers data updater and update servers data
      • update default OpenVPN ports: 8080 for UDP, 8443 for TCP (according to https://github.com/pia-foss/manual-connections/commit/8a75e46be81583d17f9ab3570881419b35000969)
      • handle "port is busy" messages and retry port forwarding logic
    • ProtonVPN: fix updater code
    • Vyprvpn: update OpenVPN configs zip URL (#3264)

    PS:

    • No time to make a video or a rant section yet, but will do for v3.42.0 for sure!
    • v3.42 probably coming end of August/early September!
    • Sorry for the spam, first few v3.41.2 release attempts decided to give me a bunch of surprises in the CI, so here it is again
  3. v3.41.12026-02-11 · 2026-02-11 14:17 UTC
    查看更新说明

    Fixes

    • Healthcheck: prevent race condition making Gluetun hang completely (#3123)
    • Wireguard kernelspace detection fixed in some cases
    • OpenVPN 2.5 is not needed as long as it's not to be used, resolving some kernel incompatibilities
    • HTTP proxy: remove info log when no Proxy-Authorization header is present
    • ProtonVPN:
      • update OpenVPN settings (#3120)
      • support port 51820 for UDP OpenVPN connections
  4. v3.41.02025-12-25 · 2025-12-25 00:38 UTC
    查看更新说明

    Video of me reading out this release

    Thank you all for your patience for this release which took its sweet time 🙏⏲️

    I have been rather absent in a good part of 2025 due to work and life getting in the way, and I would like to thank many of you for helping out around in issues and discussions, and for the few code contributors whilst I was away.

    On this release, many of the features you see are the result of behind-the-scene work of the last few years (notably on dns) and I'm super glad they are finally in Gluetun! A lot more to come in v3.42.0, there is already a pile of pull requests waiting 🚀

    Final note, introducing the RANTING SECTION at the bottom of this changelog. This section might also be in the future releases (unfortunately)!

    Happy holidays! 🎄 🎅 ❄️ ⛄

    Features

    • DNS
      • (K8s users read this) Local network names resolution using private DNS resolvers found at container start (#2970)
      • DNS over HTTPS support (see DNS_UPSTREAM_RESOLVER_TYPE below)
      • DNS_UPSTREAM_RESOLVER_TYPE option which can be dot (DNS over TLS), doh (DNS over HTTPS) or plain (plaintext over UDP)
      • DNS over TLS re-uses TCP connections which should put less stress on TCP-connections-rate-limiting by the VPN server
      • DNS requests blocked are logged with a reason
      • DNS rebinding protection is always enabled, but hostnames can be excluded with DNS_REBINDING_PROTECTION_EXEMPT_HOSTNAMES
      • i/o timeout errors are now logged at the debug level instead of warn level
    • healthcheck system reworked: more robust and less impact on other applications (#2923)
      • Three checks are performed:
        • startup full check: when the VPN connection is first established, perform a TCP+TLS dial to HEALTH_TARGET_ADDRESSES with a timeout of 6 seconds
        • periodic full check: every 5 minutes, perform a TCP+TLS dial to HEALTH_TARGET_ADDRESSES, with up to 3 tries of 10s, 15s, and 30s timeouts
        • periodic small check: every minute, perform ICMP pings to HEALTH_ICMP_TARGET_IPS, with a fallback to plain DNS (UDP) lookups of github.com to cloudflare+google, with up to 10 tries of 5s, 5s, 5s, 10s, 10s, 10s, 15s, 15s, 15s, and 30s timeouts
      • If any of these checks fail, the VPN connection is restarted
      • Reduced impact on TCP to allow for higher bandwidth in TCP torrenting
      • New option HEALTH_TARGET_ADDRESSES=cloudflare.com:443,github.com:443 to have a fallback address
      • New option HEALTH_ICMP_TARGET_IPS=1.1.1.1,8.8.8.8 to have 8.8.8.8 as a fallback address
      • New option HEALTH_SMALL_CHECK_TYPE which can be dns or icmp. By default it uses icmp and falls back to dns if icmp isn't permitted.
      • New option HEALTH_RESTART_VPN: you should really leave it to on, unless you have trust issues with the healthcheck.
    • built-in servers data updates:
      • Cyberghost
      • ExpressVPN
      • Mullvad
      • Privado
      • Private Internet Access
      • SlickVPN (mere 29 hardcoded servers 🤷)
      • ProtonVPN
      • Surfshark
      • Torguard
    • control server:
      • HTTP_CONTROL_SERVER_AUTH_DEFAULT_ROLE option (JSON encoded). For example: {"auth":"basic","username":"me","password":"pass"} or {"auth":"apiKey","apikey":"xyz"} or {"auth":"none"}.
      • log number of roles read from auth file
    • VPN server side port forwarding:
      • support {{PORT}} template variable on top of {{PORTS}}
      • support {{VPN_INTERFACE}} template variable which is by default tun0
    • Public IP data fetcher queries all data sources in parallel and picks the most popular result
    • bump Alpine from 3.20 to 3.22
    • wireguard: on error parsing WIREGUARD_ENDPOINT_IP, mention it must be an IP address for the time being
    • new ascii logo logged out at program exit... did any of you spot it? 👀

    Fixes

    • Wireguard:
  5. v3.40.42025-12-24 · 2025-12-24 03:25 UTC
    查看更新说明

    Fixes

    • DNS:
      • prevent restart crash if DOT=off and DNS_KEEP_NAMESERVER=off
      • retry on next period the blocklists update after a failed update
    • WIREGUARD_ENDPOINT_IP overrides the IP address correctly (regression introduced in v3.39.0)
    • ExpressVPN hardcoded servers data updated (#2888 - huge thanks to the manual work of @Lobstrosity)
    • PureVPN OpenVPN configuration updated (from #2991, credits to @mlapaj)
    • SlickVPN updater: only keep 11 servers hardcoded and drop website scraping code
    • VPNSecure updater fixed, with region and city data allowed to be set to N / A
    • VPN Unlimited updater: no longer valid hardcoded hosts removed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Gluetun VPN client

    Lightweight swiss-army-knife-like VPN client to multiple VPN service providers

    ⚠️ This and gluetun-wiki are the only websites for Gluetun, other websites claiming to be official are scams ⚠️

    🗯️ this repository will be migrated to github.com/passteque/gluetun on 2026-05-21, which is a Github organization under my sole control, so don't get alarmed if you get redirected in the coming days 😉 Reason being migrating Github sponsors to the Open source collective due to my personal situation, basically annoying paperwork. On the plus side, it will be more transparent and funds donated will only be used for the project. The Docker image names will remain the same.

    Title image

    Build status

    Docker pulls qmcgaw/gluetun Docker pulls qmcgaw/private-internet-access

    Docker stars qmcgaw/gluetun Docker stars qmcgaw/private-internet-access

    Last release Last Docker tag Last release size GitHub last release date Commits since release

    Latest size

    GitHub last commit GitHub commit activity GitHub closed PRs GitHub issues GitHub closed issues

    Code size GitHub repo size Go version

    Visitors count

    Quick links

    Features

    • Based on Alpine 3.23 for a small Docker image of 43.1MB
    • Supports: AirVPN, Cyberghost, ExpressVPN, FastestVPN, Giganews, HideMyAss, IPVanish, IVPN, Mullvad (Wireguard only), NordVPN, Privado, Private Internet Access, PrivateVPN, ProtonVPN, PureVPN, SlickVPN, Surfshark, TorGuard, VPNSecure.me, VPNUnlimited, Vyprvpn, Windscribe servers
    • Supports OpenVPN for all providers listed
    • Supports Wireguard both kernelspace and userspace
      • For AirVPN, FastestVPN, Ivpn, Mullvad, NordVPN, ProtonVPN, Surfshark and Windscribe
      • For Cyberghost, Private Internet Access, PrivateVPN, PureVPN, Torguard, VPN Unlimited and VyprVPN using the custom provider
      • For custom Wireguard configurations using the custom provider
      • More in progress, see #134
    • Supports AmneziaWG only with the custom provider for now
    • DNS over TLS baked in with service provider(s) of your choice
    • DNS fine blocking of malicious/ads hostnames and IP addresses, with live update every 24 hours
    • Choose the vpn network protocol, udp or tcp
    • Built in firewall kill switch that only allows traffic through the VPN, to the VPN server, and to allowed LAN devices
    • Built in Shadowsocks proxy server (protocol based on SOCKS5 with an encryption layer, tunnels TCP+UDP)
    • Built in Socks5 proxy server (tunnels TCP+UDP) - partial credits to @angelakis and @adjscent
    • Built in HTTP proxy (tunnels HTTP and HTTPS through TCP)
    • Connect other containers to it
    • Connect LAN devices to it
    • Compatible with amd64, i686 (32 bit), ARM 64 bit, ARM 32 bit v6 and v7, and even ppc64le 🎆
    • Custom VPN server side port forwarding for Private Internet Access, PrivateVPN and ProtonVPN
    • Possibility of split horizon DNS by selecting multiple DNS over TLS providers
    • Can work as a Kubernetes sidecar container, thanks @rorph

    Setup

    🎉 There are now instructions specific to each VPN provider with examples to help you get started as quickly as possible!

    Go to the Wiki!

    🐛 Found a bug in the Wiki?!

    Here's a docker-compose.yml for the laziest:

    ---
    services:
      gluetun:
        image: qmcgaw/gluetun
        # container_name: gluetun
        # line above must be uncommented to allow external containers to connect.
        # See https://github.com/qdm12/gluetun-wiki/blob/main/setup/connect-a-container-to-gluetun.md#external-container-to-gluetun
        cap_add:
          - NET_ADMIN
        devices:
          - /dev/net/tun:/dev/net/tun
        ports:
          - 8888:8888/tcp # HTTP proxy
          - 8388:8388/tcp # Shadowsocks
          - 8388:8388/udp # Shadowsocks
        volumes:
          - /yourpath:/gluetun
        environment:
          # See https://github.com/qdm12/gluetun-wiki/tree/main/setup#setup
          - VPN_SERVICE_PROVIDER=ivpn
          - VPN_TYPE=openvpn
          # OpenVPN:
          - OPENVPN_USER=
          - OPENVPN_PASSWORD=
          # Wireguard:
          # - WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU=
          # - WIREGUARD_ADDRESSES=10.64.222.21/32
          # Timezone for accurate log times
          - TZ=
          # Server list updater
          # See https://github.com/qdm12/gluetun-wiki/blob/main/setup/servers.md#update-the-vpn-servers-list
          - UPDATER_PERIOD=
    

    🆕 Image also available as ghcr.io/qdm12/gluetun

    Fun graphs

    Star History Chart

    License

    MIT