selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

gluetun logo

Self-host gluetun

v3.41.3
ReleaseOpen SourceMIT
Docker ComposeCompose file & guide
docker-compose up -d
Updated3 months ago
LanguageGo
Setup difficultyModerate
Stars
16 086
Rating
5.0 (1)
Port
8000 (control server), 8888 (HTTP proxy), 8388 (Shadowsocks), 1080 (SOCKS5)
Docker
qmcgaw/gluetun
gluetun screenshot 1

What is gluetun?

Gluetun is a versatile VPN client packaged in a lightweight Docker container. It supports a wide range of VPN providers, including AirVPN, Cyberghost, ExpressVPN, Mullvad, NordVPN, Private Internet Access, ProtonVPN, Surfshark, and many more. The project is built on Alpine Linux and Go, ensuring a small footprint and high performance.

Gluetun offers both OpenVPN and WireGuard support, with the ability to fine-tune VPN server selection, DNS over TLS, and built-in proxy servers (Shadowsocks, SOCKS5, HTTP). It also includes a firewall kill switch to ensure traffic only flows through the VPN, making it ideal for privacy-focused users. The client can be used to route traffic from other Docker containers or LAN devices, providing a flexible solution for securing network traffic.

The project is actively maintained, with a strong focus on security, privacy, and ease of use. It is licensed under the MIT license and is fully open-source.

gluetun alternatives

Should you self-host gluetun?

gluetun scores 75/100 on selfhost.directory (how scoring works) and ranks #5 of 56 in VPN. It has 16 086 GitHub stars, +332 in the last 30 days.

It shipped 8 stable releases in the past year. The latest, v3.41.3, came out on 30 July 2026. New versions land roughly every 1 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Tailscale (84/100, 39 141 stars). It scores higher overall, so compare the two before you pick. See gluetun vs Tailscale side by side.

Features

  • Built-in proxy servers
  • DNS over TLS
  • Docker Integration
  • Firewall kill switch
  • Health Checks
  • IPv6 Support
  • LAN device support
  • Multi-provider VPN support
  • OpenVPN and WireGuard
  • Port Forwarding

gluetun 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.

How to install gluetun

Install gluetun with Docker Compose

Docker Engine 20.10+
Environment variables
VPN_SERVICE_PROVIDER: The VPN provider to use (e.g., pia, nordvpn).
VPN_TYPE: The VPN type (openvpn or wireguard).
OPENVPN_USER: Your OpenVPN username.
OPENVPN_PASSWORD: Your OpenVPN password.
TZ: Timezone for log timestamps.
UPDATER_PERIOD: How often to update the VPN server list (e.g., 24h).
version: '3'
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: 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
      - 1080:1080/tcp # SOCKS5
    volumes:
      - ./gluetun:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=pia # Example: Private Internet Access
      - VPN_TYPE=openvpn
      - OPENVPN_USER=your_username
      - OPENVPN_PASSWORD=your_password
      - TZ=UTC
      - UPDATER_PERIOD=24h
  1. Save the above as docker-compose.yml.
  2. Replace your_username and your_password with your VPN credentials.
  3. Run docker-compose up -d.

How to configure gluetun

  • VPN_SERVICE_PROVIDERpiaThe VPN provider to use (e.g., pia, nordvpn).

    values: pia, nordvpn, mullvad, protonvpn, surfshark, etc.

  • VPN_TYPEopenvpnThe VPN type to use (openvpn or wireguard).

    values: openvpn, wireguard

  • OPENVPN_USERYour OpenVPN username.

    values: Any valid username

  • OPENVPN_PASSWORDYour OpenVPN password.

    values: Any valid password

  • WIREGUARD_PRIVATE_KEYYour WireGuard private key.

    values: Any valid WireGuard private key

gluetun releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

What is the firewall kill switch?

The firewall kill switch ensures that all traffic is blocked if the VPN connection drops, preventing any data leaks. It is enabled by default and can be configured using the `FIREWALL_ENABLED_DISABLING_IT_SHOOTS_YOU_IN_YOUR_FOOT` environment variable.

How do I update the VPN server list?

The VPN server list can be updated automatically by setting the `UPDATER_PERIOD` environment variable (e.g., `24h`). For more details, see the [servers listing and updating guide](https://github.com/qdm12/gluetun-wiki/blob/main/setup/servers.md).

Can I use Gluetun on a Raspberry Pi?

Yes, Gluetun supports ARM architectures, including Raspberry Pi. For setup instructions, check the [32-bit prerequisites page](https://github.com/qdm12/gluetun-wiki/blob/main/setup/prerequisites/32bit.md).

How do I connect other containers to Gluetun?

You can connect other Docker containers to Gluetun by setting their network mode to `service:gluetun`. For detailed instructions, see the [connect a container to Gluetun guide](https://github.com/qdm12/gluetun-wiki/blob/main/setup/connect-a-container-to-gluetun.md).

What VPN providers are supported?

Gluetun supports a wide range of VPN providers, including AirVPN, Cyberghost, ExpressVPN, Mullvad, NordVPN, Private Internet Access, ProtonVPN, Surfshark, and many more. For a full list, check the [providers directory](https://github.com/qdm12/gluetun-wiki/blob/main/setup/providers).

More in VPN

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…