Easiest Way To Setup Your Own VPN With A Single Docker Command And Run It For Free In the Cloud

ManagedKube
4 min readFeb 9, 2015

Do you travel a lot? Do you use a lot of public WiFi? Do you just want to hide your internet traffic for no reason at all? Well, one way to achieve this is to use a VPN. This will encrypt all of your traffic from where you are to your VPN. Now you are surfing the internet securely!

Sure you can get a service and pay for it every month. LifeHacker has a list of the Five Best VPN Service Providers and they range from $4/month to over $20/month.

But what if you want it for free? Well not exactly free. Remember nothing in life is free. You still have to put a little bit of work into it but once setup, you dont have to touch it ever again!

Lets say you already have a Docker server setup. All you have to do is run the following “docker run” command to start up the VPN endpoint. Now you can connect to it from your machines (Mac, Windows, iPhone, Android, etc). Scroll down to see more info on how to connect to this VPN.

docker run -d \
-p 500:500/udp \
-p 4500:4500/udp \
-p 1701:1701/tcp \
-e PSK=some-pre-shared-secret \
-e USERNAME=joe \
-e PASSWORD=very-secret-password \
siomiz/softethervpn

What if you dont have a Docker server? Dont worry! I will show you a super easy way to get this up and running without touching a Linux command line!

There is this cool service called Tutum.co that can help you provision all of this up via a web GUI. I wont rewrite the parts on how to get Tutum going. They have these instructions for you.

——instructions here…

Ok, now that you have a Docker server up and running in Tutum. You can now create the VPN service.

Step 1: Click on the Create Service button on the Dashboard page

Step 2: In the image name put in “siomiz/softethervpn” and click select on the first one to move to the next step.

Step 3: We are now going to edit the container info with what we would have done on the command line.

On this screen click on the “Ports” area to have it reveal this section so that we can change it. Once it is un-greyed out, we will have to check the checkbox on all three Published ports. Then we will ahve to click on the “dynamic” word. This will change to an input box and type in the port number that is to the right of it. We want all of these to be these ports and not dynamic b/c we dont want to have to change all of our Clients connection info.

Now click on the “Next: environment variables” button on the bottom.

Step 4: Add in environmental variables

We will add in the same environmental variables as we did in the command line version.

PSK=fd40de14a6785482cb5ea2f20bfd466838af606c2fc6f836961ce4d
USERNAME=john
PASSWORD=very-secret-password

Now click the “Create and deploy” button on the bottom. This will bring you to a detailed screen of the container starting up. It might take a few minutes for it to start up. Your Docker server has to go and download this Docker image first.

Connecting to your VPN

No matter how you got to this point from either running the “docker run” command from the CLI or using Tutum, connecting to your VPN will be the same.

The SoftEther.org website has great walk throughs on how to connect in. In fact they are so good, I am just going to point you to their tutorial section.

ManagedKube built k8sBot, a point-and-click interface for Kubernetes in Slack. Now, software developers and novice k8s users can get meaningful Kubernetes information with just one click in Slack, where you’re already talking with your team. With k8sBot, you can retrieve pod status, get pod logs, and get troubleshooting recommendations based on real-time information from your cluster’s Kubernetes API.

Learn more and start a free trial of k8sBot at managedkube.com

--

--

ManagedKube

We’re making Kubernetes easier to use with a point-and-click interface in Slack. Get meaningful k8s information with one click. Learn more at ManagedKube.com