Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description


Ubuntu:1404 based vpn with torrents/proxy (openvpn, deluged, deluge-web, dante-server)

Complete run command with all options

docker run -d -p 8112:8112 -p 1080:1080 \
    --name vpn \
    --dns= \
    --cap-add=NET_ADMIN \    
    -v /mytorrentdir:/torrents \
    -v /mydelugeconfigdir:/app/deluge \
    -v /etc/localtime:/etc/localtime:ro \
    -e DELUGE_UID=500 -e DELUGE_GID=500 \
    -e HOST_SUBNET= \
    -e PIA_USER=<user> \
    -e PIA_PASS=<password> \
    -e PIA_CLIENT=<optionalpiaclient> \
    -e \        

Change directory mappings as appropriate (delugeconfig, torrents)


  • DELUGE_UID and DELUGE_GID are optional, but will default to 500/500. Specify the UID/GID that corresponds to the HOST UID/GID you want to own the downloads, config and movies directories.
  • The deluge web will only work on your local subnet. Policy based routing is what led me to this solution, I'm not going down that road again. If you need access from the outside, either VPN or SSH/Port forward in.
  • You must map a torrents directory, no torrents inside container
  • If you want it to restart on reboot, add --restart=always
  • If you leave the DNS out, your local dns servers will be used. Not good for privacy.
  • The NET_ADMIN capability is needed to create the TUN device
  • The host subnet needs to be in CIDR notation. For example if your host network is 192.168.1.x with a netmask of, then HOST_SUBNET=
  • The PIA_CLIENT is optional, but if you generate one yourself port mappings will be preserved between cold starts. Here is one way to generate a PIA_CLIENT.
head -n 100 /dev/urandom | md5sum | tr -d " -"
  • PIA_GATEWAY is just a pia vpn hostname. (,, etc)
  • After running for the first time, setup deluge so all torrents begin with /torrents
Docker Pull Command
Source Repository

Comments (5)
a year ago


I'm trying to install the new PIA app for linux inside a docker container, but I can't really make it work...

Can you give me a hint? This is the error:

Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

3 years ago

Couple of options.

#1 - Use the torguard torrent IP detecter.

#2 - Docker exec into the container and run "curl"

#3 - Setup firefox (or another browser that allows you to specify a proxy) and point it at <dockerhost:1080> and browse.

3 years ago

First of all many thanks for putting this container together, I love it as it was what i was planning on doing when i first found out about docker but dont know if i had the skills to do it.

Id also like to ask if there is any way to confirm the VPN status, id like to be able to pop in the the host OS now and then and check on it.

Many thanks again

3 years ago

I'd guess either the vpn disconnected or you are using a endpoint that doesn't support port forwarding with their tool. I don't think all of them do.

Right now the vpn doesn't auto-reconnect when it fails. The routes stay up, and dns can't resolve. I just restart the container to fix it.

3 years ago

Any idea why I might keep getting:

ERROR: Port is not an integer

When I run docker logs?