Skip to main content

VPN Setup for CasaOS

In this video we're going to take a look at how to run the traffic of Docker containers through a VPN container for better online security and anonymity.

I’ve made a video like this in the past, but it was done in Portainer and Dockge, but the process of doing it in CasaOS is a bit different.

If you want more details on how to use CasaOS for your homelab, you can check out my other video on the topic or do a search for CasaOS on YouTube.

Here are the docker-compose setups I used in the video:

Gluetun VPN Container:

version: "3"
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    restart: unless-stopped
    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
      - 8080:8080 # qbt
      - 8999:8999 # qbt
      - 5000:5000 # whoogle
    volumes:
      - /DATA/AppData/Gluetun:/gluetun
    environment:
      # See https://github.com/qdm12/gluetun-wiki/tree/main/setup#setup
      - VPN_SERVICE_PROVIDER=private internet access
      - VPN_TYPE=openvpn
      # OpenVPN:
      - OPENVPN_USER=username
      - OPENVPN_PASSWORD=password
      # Timezone for accurate log times
      - TZ=America/Denver
      # Server list updater
      # See https://github.com/qdm12/gluetun-wiki/blob/main/setup/servers.md#update-the-vpn-servers-list
      - UPDATER_PERIOD=24h

Whoogle Container:

services:
  whoogle:
    image: benbusby/whoogle-search:latest
    #container_name: whoogle # can't use container name with network_more on CasaOS
    restart: unless-stopped
    network_mode: container:gluetun

QBT Container:

services:
    qbittorrentvpn:
        privileged: true
        volumes:
            - /DATA/AppData/qbittorrent/config:/config
            - /DATA/AppData/qbittorrent/downloads:/downloads
        environment:
            - VPN_ENABLED=no
        image: markusmcnugen/qbittorrentvpn
        network_mode: container:gluetun

 

Gluetun: https://github.com/qdm12/gluetun
Gluetun Wiki: https://github.com/qdm12/gluetun-wiki
Gluetun Docker: https://hub.docker.com/r/qmcgaw/gluetun
Gluetun Proxmox: https://github.com/qdm12/gluetun-wiki/blob/main/errors/tun.md

Whoogle Resource: https://hub.docker.com/r/benbusby/whoogle-search

QBT Resource (I wouldn't use this for anything other than testing): https://hub.docker.com/r/markusmcnugen/qbittorrentvpn

Private Internet Access (PIA) VPN: https://dbte.ch/piavpn (Affiliate Link)