Skip to content

Instantly share code, notes, and snippets.

@umardx
Last active July 1, 2018 05:49
Show Gist options
  • Save umardx/eb5a0bcd305a09610f98272bd3e0d368 to your computer and use it in GitHub Desktop.
Save umardx/eb5a0bcd305a09610f98272bd3e0d368 to your computer and use it in GitHub Desktop.
Setup own VPN server in 15 minutes with Docker

It’s VERY easy to setup your own VPN with docker. This guide assumes you’re ok with operating a linux box but know nothing about docker. I’ll break it down into easy steps:

Setup a docker host

Install docker on the host:

$ curl -sSL https://get.docker.com/ | sh

Run the docker image

Make directory for docker volume:

$ mkdir $HOME/openvpn-data

Simply run this:

$ docker run -d --cap-add=NET_ADMIN -v $HOME/openvpn-date:/etc/openvpn -p 5222:443/tcp -p 443:443/tcp jpetazzo/dockvpn

Docker will take about a minute to do its magic and then return you to the command line. To see that it is working do this:

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                                             NAMES
147ae44749ae        jpetazzo/dockvpn    "/bin/sh -c run"    23 hours ago        Up 23 hours         0.0.0.0:443->443/tcp, 1194/udp, 8080/tcp, 0.0.0.0:5222->443/tcp   stupefied_mcnulty

VPN server and client config will be available at $HOME/openvpn-data

@ToLive
Copy link

ToLive commented Apr 25, 2018

Small typo, should be $openvpn-data
docker run -d --cap-add=NET_ADMIN -v $HOME/openvpn-date:/etc/openvpn -p 5222:443/tcp -p 443:443/tcp jpetazzo/dockvpn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment