First of all, we are going to store all the data in a Docker shared volume, called openvpn_data
.
To initialise the OpenVPN configuration and CA:
$ docker run -v openvpn_data:/etc/openvpn --rm evolvedm/openvpn-rpi ovpn_genconfig -u udp://your-vpn.address.com
$ docker run -v openvpn_data:/etc/openvpn --rm -it evolvedm/openvpn-rpi ovpn_initpki
To start daemon (and auto-restart it):
$ docker run -v openvpn_data:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN -e --restart=always --name openvpn_server evolvedm/openvpn-rpi
And to create new profiles:
$ docker run -v openvpn_data:/etc/openvpn --rm -it evolvedm/openvpn-rpi easyrsa build-client-full **CLIENTNAME**
$ docker run -v openvpn_data:/etc/openvpn --rm evolvedm/openvpn-rpi ovpn_getclient **CLIENTNAME** > **CLIENTNAME**.ovpn
Then you can download your .ovpn file and start using your OpenVPN!! (if the port is correctly exposed)
I'm not a real fan of giving your data security to other's containers, so if you want to compile your own image, you can use this repo:
looks like you are running the script in a folder in which you don't have permissions.
docker run -v openvpn_data:/etc/openvpn --rm evolvedm/openvpn-rpi ovpn_getclient CLIENT
is run with sudo.> CLIENT.ovpn
is done with your user's privileges.Your best chance is to execute it in a folder in which you can create/write files or: