OpenVPN-AIO-Client-Torless

OpenVPN-AIO-Client-Torless

Docker app from testdasi's Repository

Overview

An "all-in-one" docker for all your private browsing needs (including OpenVPN client with nftables kill switch ; Socks5 + HTTP proxy to the VPN ; DNS server to DoT (DNS-over-TLS) services). It's the same as OpenVPN AIO Client docker but without TOR. NOTE: you must place your own OpenVPN configuration to the host path that is mapped to /etc/openvpn (The ovpn file must be named openvpn.ovpn. Credentials + certs can be in the same file or split out into multiple files - the flexibility is yours.) Set DNS_SERVERS to 127.2.2.2 to use DNS-over-TLS (use google and cloudflare services by default). Your DNS query out of the VPN exit will also be encrypted for even more security. Set it to other services IP's will use normal unencrypted services. Set HOST_NETWORK to your Unraid server network in CIDR format e.g. 192.168.1.0/24. For more detailed instructions, refer to the support thread (https://forums.Unraid.net/topic/96233-support-testdasi-repo/) or project page (https://github.com/testdasi/openvpn-client-aio).

openvpn-client-aio

An "all-in-one" docker for all your private browsing needs. Built for both Unraid and Raspberry Pi 4 but should work in other Linux amd64 / arm32v7 / arm32v6 / i386 docker environments.

PULL THE RIGHT TAG!

  • I have finally managed to get multi-arch buildx working. LOL. Docker should automatically determine the right architecture to pull.
    • For verison with TOR (and Privoxy) -> pull testdasi/openvpn-client-aio:latest
    • For version without TOR (and Privoxy) -> pull testdasi/openvpn-client-aio:latest-torless

High-level instructions

  • Copy your OpenVPN configuration to the host path that is mapped to /etc/openvpn (must include openvpn.ovpn + credentials + certs).
  • Start docker

Key features

  1. OpenVPN client to connect to your favourite VPN provider. Full freedom with what you want to do with the ovpn file.
  2. 2 sets of kill switches. NFT kill switch to block connection when VPN is down. Piping kill switch HTTP proxy -> SOCKS5 proxy -> VPN tun0 / TOR tunnel.
  3. Stubby for DNS server to connec to DoT (dns-over-tls) services (ip:53 or 127.2.2.2:5253). Use Google and Cloudflare for best performance.
  4. Dante for SOCKS5 proxy to your VPN (ip:9118)
  5. Tinyproxy for HTTP proxy to your VPN (ip:8118)
  6. Torsocks for SOCKS5 proxy to TOR (ip:9119)
  7. Privoxy for HTTP proxy to TOR (ip:8119)

Bits and bobs

  • OpenVPN config files MUST be named openvpn.ovpn. The certs and credentials can be included in the config file or split into separate files. The flexibility is yours.
  • Explaining the parameters (the values you see in Usage section are default values)
    • DNS_SERVERS: set to 127.2.2.2 will point to stubby (which in turn points to Google / Cloudflare DoT services). Your DNS queries out of the VPN exit will also be encrypted before arriving at Google / Cloudflare for even more privacy. Change it to other comma-separated IPs (e.g. 1.1.1.1,8.8.8.8) will use normal unencrypted DNS, or perhaps a pihole in the local network.
    • HOST_NETWORK: to enable free flow between host network and the docker (e.g. when using docker bridge network). Otherwise, your proxies will only work from within the docker network. Must be in CIDR format e.g. 192.168.1.0/24
    • DNS_SERVER_PORT: the docker will serve as a DNS server for the local network so everything, including DNS, comes out of the VPN exit.
      • Work best if set to 53 as most things can't handle DNS on other ports. In which case, you have to give the docker its own static IP (i.e. use docker macvlan network) if the host also uses port 53 e.g. if you run a Pihole on the host IP. For Unraid, use Custom : br0 / br1 network (to enable this, go to Settings -> Docker).
      • You will need to set each device DNS to the docker IP.
      • Alternatively, you can set your router DHCP to set DNS to the docker IP.
    • SOCKS/HTTP_PROXY_PORT: use these proxies if you want to exit through your VPN. Point to your docker IP on the respective ports.
    • TOR_SOCKS/HTTP_PORT: use these proxies if you want to exit through TOR. Point to your docker IP on the respective ports.
    • The docker port mappings map host ports to docker ports. The docker ports are determined by the aforementioned PORT variables. So if you change the docker variables, you should also change the port mappings accordingly.
  • Choice of DoT (instead of DoH - dns-over-https) was intentional. When OpenVPN connects, it needs to resolve the VPN server domain so a port needs to open briefly. DoH would require opening HTTPS port (443), which shares with normal web-browsing so there's a potential point of leakage albeit only momentarily. DoT uses port 853 pretty much for itself. Of course, you can use IP instead of domain but that would restrict the use cases.
  • Based on Debian Buster base image mainly because Raspbian Buster is derived from the same. This allows easier development, testing and building on my end.
    • I originally developed this with iptables kill switch; however, iptables is sort of emulated from nftables in Debian Buster. Hence, I updated to using NFT kill switch instead. Iptables versions are kept in /iptables/* in case we need to revert back in the future.
    • Choices of stubby / dante / tinyproxy / torsocks / privoxy are out of convenience i.e. they are debian packages so no need to compile from source. A very-much-appreciated quality-of-life improvement.

Usage

docker run -d \
    --name=<container name> \
    --cap-add=NET_ADMIN \
    -v <path for openvpn config>:/etc/openvpn \
    -e DNS_SERVERS=127.2.2.2 \
    -e HOST_NETWORK=192.168.1.0/24 \
    -p 53:53/tcp \
    -p 53:53/udp \
    -p 9118:9118/tcp \
    -p 8118:8118/tcp \
    -p 9119:9119/tcp \
    -p 8119:8119/tcp \
    -e DNS_SERVER_PORT=53 \
    -e SOCKS_PROXY_PORT=9118 \
    -e HTTP_PROXY_PORT=8118 \
    -e TOR_SOCKS_PORT=9119 \
    -e TOR_HTTP_PORT=8119 \
    testdasi/openvpn-client-aio:<tag>

Unraid example

docker run -d \
    --name='OpenVPN-AIO-Client' \
    --cap-add=NET_ADMIN \
    -v '/mnt/user/appdata/openvpn-aio-client':'/etc/openvpn':'rw' \
    -e 'DNS_SERVERS'='127.2.2.2' \
    -e 'HOST_NETWORK'='192.168.1.0/24' \
    -p '8153:53/tcp' \
    -p '8153:53/udp' \
    -p '9118:9118/tcp' \
    -p '8118:8118/tcp' \
    -p '9119:9119/tcp' \
    -p '8119:8119/tcp' \
    -e 'DNS_SERVER_PORT'='53' \
    -e 'SOCKS_PROXY_PORT'='9118' \
    -e 'HTTP_PROXY_PORT'='8118' \
    -e 'TOR_SOCKS_PORT'='9119' \
    -e 'TOR_HTTP_PORT'='8119' \
    --net='bridge' \
    -e TZ="Europe/London" \
    -e HOST_OS="Unraid" \
    'testdasi/openvpn-client-aio:latest' 

Notes

  • I code for fun and my personal uses; hence, these niche functionalties that nobody asks for. ;)
  • Tested only with PIA since I can't afford anything else. Theoretically, it should work with any VPN services that support OpenVPN.
  • If you like my work, a donation to my burger fund is very much appreciated.

Donate.

Install OpenVPN-AIO-Client-Torless on Unraid in a few clicks.

Find OpenVPN-AIO-Client-Torless in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for OpenVPN-AIO-Client-Torless Review the template variables and paths Click Install

Download Statistics

123,275
Total Downloads
1,462
This Month
1,245
Avg / Month

Total Downloads Over Time

Loading chart...

Related apps

Details

Repository
testdasi/openvpn-client-aio:latest-torless
Last Updated2026-06-27
First Seen2021-04-11

Runtime arguments

Network
bridge
Shell
bash
Privileged
false
Extra Params
--cap-add=NET_ADMIN

Template configuration

OpenVPN ConfigPathrw

Container Path: /etc/openvpn

Target
/etc/openvpn
Default
/mnt/user/appdata/openvpn-aio-client
Value
/mnt/user/appdata/openvpn-aio-client
DNS Server TCPPorttcp

Container Port: 53

Target
53
Default
8153
Value
8153
DNS Server UDPPortudp

Container Port: 53

Target
53
Default
8153
Value
8153
Socks5 proxy to VPNPorttcp

Container Port: 9118

Target
9118
Default
9118
Value
9118
HTTP Proxy to VPNPorttcp

Container Port: 8118

Target
8118
Default
8118
Value
8118
Socks5 proxy to TORPorttcp

Container Port: 9119

Target
9119
Default
9119
Value
9119
HTTP Proxy to TORPorttcp

Container Port: 8119

Target
8119
Default
8119
Value
8119
DNS_SERVERSVariable

Container Variable: DNS_SERVERS

Default
127.2.2.2
Value
127.2.2.2
HOST_NETWORKVariable

Container Variable: HOST_NETWORK

Default
192.168.1.0/24
Value
192.168.1.0/24
DNS_SERVER_PORTVariable

Container Variable: DNS_SERVER_PORT

Default
53
Value
53
SOCKS_PROXY_PORTVariable

Container Variable: SOCKS_PROXY_PORT

Default
9118
Value
9118
HTTP_PROXY_PORTVariable

Container Variable: HTTP_PROXY_PORT

Default
8118
Value
8118
TOR_SOCKS_PORTVariable

Container Variable: TOR_SOCKS_PORT

Default
9119
Value
9119
TOR_HTTP_PORTVariable

Container Variable: TOR_HTTP_PORT

Default
8119
Value
8119