Skip to main content

Gluetun VPN

·
Docker VPN Gluetun security Privacy Docker Compose
Table of Contents

🌟My Gluetun Setup
#

This Gluetun setup runs in a Docker container using the official qmcgaw/gluetun image. It provides a secure VPN tunnel, supports HTTP proxy, and Shadowsocks for enhanced privacy.


⚙️ Configuration Details
#

🌍 Environment Variables
#

VariableDescription
VPN_SERVICE_PROVIDER=private internet accessSpecifies the VPN provider
OPENVPN_USER=Your usernameVPN username (replace with actual credentials)
OPENVPN_PASSWORD=Your PasswordVPN password (replace with actual credentials)
HTTPPROXY=onEnables HTTP proxy
SERVER_REGIONS=UK LondonSpecifies the VPN server region

📂 Volume Mounts
#

VolumeDescription
~/gluetun_vpn/config:/gluetunStores Gluetun’s configuration and settings

🔗 Networking
#

Port MappingFunction
8888:8888/tcpHTTP proxy
8388:8388/tcpShadowsocks (TCP)
8388:8388/udpShadowsocks (UDP)

🔄 Restart Policy
#

PolicyDescription
unless-stoppedEnsures the container restarts automatically unless manually stopped

📜 My Docker Compose Configuration
#

services:
  gluetun:
    container_name: gluetun
    image: qmcgaw/gluetun:v3
    cap_add:
      - NET_ADMIN
    ports:
      - 8888:8888/tcp # HTTP proxy
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
    volumes:
      - ~/gluetun_vpn/config:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=private internet access
      - OPENVPN_USER=Your username
      - OPENVPN_PASSWORD=Your Password
      - HTTPPROXY=on
      - SERVER_REGIONS=UK London
    restart: unless-stopped

🔐 Using Docker Secrets for Environment Variables
#

You can set any environment variable from a file by using a special prepend FILE__.

For example:

FILE__MYVAR=/run/secrets/mysecretvariable