Ubuntu:1404 based Privateinternetaccess.com 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=184.108.40.206 \ --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=192.168.1.0/24 \ -e PIA_USER=<user> \ -e PIA_PASS=<password> \ -e PIA_CLIENT=<optionalpiaclient> \ -e PIA_GATEWAY=piavpnaddress.com \ jbogatay/piavpn
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 255.255.255.0, then HOST_SUBNET=192.168.1.0/24
- 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. (ca.privateinternetaccess.com, nl.privateinternetaccess.com, etc)
- After running for the first time, setup deluge so all torrents begin with /torrents
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
Couple of options.
#1 - Use the torguard torrent IP detecter.
#2 - Docker exec into the container and run "curl icanhazip.com"
#3 - Setup firefox (or another browser that allows you to specify a proxy) and point it at <dockerhost:1080> and browse.
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
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.
Any idea why I might keep getting:
PORT= ERROR: Port is not an integer
When I run docker logs?