Docked-VPN - A Docker-based proxy with VPN support

Jan 2021

Docked-VPN is a Docker-based proxy with support for OpenVPN. It enables you to route only the applications of your choice through a VPN. For example, you can add VPN to Firefox but not Chrome. With Docked-VPN, using VPN is as simple as connecting to a Proxy. Docked-VPN can be used with any software that supports a proxy.

How to Use

Starting Docked-VPN

You can start Docked-VPN with the following command:

docker run -v $(pwd)/<path-to-config-dir>:/vpn --privileged seedbits/docked-vpn:latest

Breaking down the above command:

  1. docker run: The command to run the Docker container.
  2. -v $(pwd)/<path-to-config-dir>:/vpn: This option makes your config directory accessible to the Docked-VPN container. The path to this directory inside the container will be /vpn. Your config directory is expected to contain a bash file and any configuration files required by Docked-VPN will execute to start OpenVPN with the configuration of your choice. Typically, contains the following single command:
    openvpn --config my-config.conf --auth-user-pass my-creds.txt"
    where, my-config.conf is the OpenVPN configuration of your VPN provider and my-creds.txt contains the username and password for your VPN.
  3. --privileged: Flag that grants Docker the privilege to create tun interface.
  4. seedbits/docked-vpn: The Docker image name.

Connecting to Docked-VPN

Once the container starts up, you can use port 3128 of the container to connect to the proxy. Configure your browser/software to use this proxy to route your traffic through the VPN.

What's inside?

The following diagram shows how Docked-VPN works.

Docked-VPN has two main components. The Squid proxy and OpenVPN. The Squid proxy accepts connections from outside the container through port 3128 and routes it through OpenVPN.

A setup without Docker

If you like to create the above setup without using Docker and Squid proxy, please refer to the article "Working on and off VPN simultaneously (Linux)". The article discusses how you can manually create the setup that Docker creates for you.

The end
Other Articles