Skip to content

Instantly share code, notes, and snippets.

@wommy
Created February 28, 2025 06:20
Show Gist options
  • Save wommy/f4e6f5dca37d988b2337a10dfe63eeb6 to your computer and use it in GitHub Desktop.
Save wommy/f4e6f5dca37d988b2337a10dfe63eeb6 to your computer and use it in GitHub Desktop.
install gluetun on a proxmox lxc

install gluetun in an lxc on proxmox

step 1 - create a new lxc with docker on the proxmox node

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/docker.sh)"

run the advanced settings to customize your install

this uses the docker lxc proxmox helper script

step 2 - tweak CT config

change the CTID for your setup

CTID="100"

cat << 'EOF' >> /etc/pve/lxc/$CTID.conf
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
EOF

step 3 - enter the container

run this from the proxmox node

lxc-attach $CTID

step 4 - gluetun docker compose

get user/pw from https://www.expressvpn.com/welcome#manual

USER="changeme"
PW="changeme"

cat << 'EOF' > docker-compose.yml
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    environment:
      - TZ=US/Eastern
      - VPN_SERVICE_PROVIDER=expressvpn
      - OPENVPN_USER=$USER
      - OPENVPN_PASSWORD=$PW
      - SERVER_COUNTRIES=USA
      - SHADOWSOCKS=on
    ports:
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
EOF

step 5 - start gluetun

let it run for a second to make sure everythings connects successfully, and then re-run it as a daemon

docker compose up

CTRL+c to exit

docker compose up -d

step 6 - test it

docker run --rm --network=container:gluetun alpine:3.20 sh -c "apk add wget && wget -qO- https://ipinfo.io"

the first time i ran this it failed, ran it again and it worked

step 7 - connect torrent client - WIP

https://shadowsocks.org/doc/configs.html#uri-and-qr-code

ss://method:password@hostname:port

step 8 - make sure its working

https://torguard.net/checkmytorrentipaddress.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment