Skip to content

Instantly share code, notes, and snippets.

@applicato
Forked from umardx/openvpn_docker.md
Created May 13, 2018 16:53
Show Gist options
  • Save applicato/53be5f8af2ed041915a0e69b038adf40 to your computer and use it in GitHub Desktop.
Save applicato/53be5f8af2ed041915a0e69b038adf40 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

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