All Projects → nickkjolsing → dockerMullvadVPN

nickkjolsing / dockerMullvadVPN

Licence: GPL-3.0 license
Mullvad VPN container tutorial for docker

Programming Languages

Dockerfile
14818 projects

Projects that are alternatives of or similar to dockerMullvadVPN

nordvpn
NordVpn Docker Client
Stars: ✭ 475 (+1150%)
Mutual labels:  container, vpn
husarnet
Husarnet is a Peer-to-Peer VPN to connect your laptops, servers and microcontrollers over the Internet with zero configuration.
Stars: ✭ 128 (+236.84%)
Mutual labels:  vpn
openbsd-server-setup
A collection of scripts to ease bootstrapping of a new OpenBSD server. Includes nginx with SSL, mail with DKIM, WireGuard and IKEv2 VPN setup.
Stars: ✭ 33 (-13.16%)
Mutual labels:  vpn
ProxmoxVE PHP API
ProxmoxVE PHP API
Stars: ✭ 78 (+105.26%)
Mutual labels:  container
openvpn
OpenVPN is an open source VPN daemon
Stars: ✭ 7,291 (+19086.84%)
Mutual labels:  vpn
k8s-knative-gitlab-harbor
Build container images with Knative + Gitlab + Harbor inside Kops cluster running on AWS
Stars: ✭ 23 (-39.47%)
Mutual labels:  container
CNeptune
CNeptune improve productivity & efficiency by urbanize .net module with meta-code to lay foundation for frameworks
Stars: ✭ 30 (-21.05%)
Mutual labels:  container
docker-axed
dockerized「AXE」daemon
Stars: ✭ 13 (-65.79%)
Mutual labels:  container
docker-jre
Lean JRE 8 Docker container
Stars: ✭ 25 (-34.21%)
Mutual labels:  container
crane
Crane is a easy-to-use and beautiful desktop application helps you build manage your container images.
Stars: ✭ 223 (+486.84%)
Mutual labels:  container
singularityware.github.io
base documentation site for Singularity software
Stars: ✭ 27 (-28.95%)
Mutual labels:  container
expfactory
software to generate a reproducible container with a battery of experiments
Stars: ✭ 29 (-23.68%)
Mutual labels:  container
micromamba-docker
Rapid builds of small Conda-based containers using micromamba.
Stars: ✭ 97 (+155.26%)
Mutual labels:  container
ibm-spectrum-scale-csi
The IBM Spectrum Scale Container Storage Interface (CSI) project enables container orchestrators, such as Kubernetes and OpenShift, to manage the life-cycle of persistent storage.
Stars: ✭ 41 (+7.89%)
Mutual labels:  container
docker-compose-moodle
This project quickly builds a local workspace for Moodle (Apache2, PHP-FPM with XDEBUG y Postgres) using containers for each of its main components. The local workspace is built and managed by Docker Compose
Stars: ✭ 33 (-13.16%)
Mutual labels:  container
prepopulated-mysql-container-example
This is an example on how to make a prepopulated container image.
Stars: ✭ 61 (+60.53%)
Mutual labels:  container
navio
Navio is a program to create and manage linux containers. This project exists only for study purposes, so feel free to contribute :)
Stars: ✭ 14 (-63.16%)
Mutual labels:  container
dockupdater
Automatically keep your docker services and your docker containers up-to-date with the latest version
Stars: ✭ 76 (+100%)
Mutual labels:  container
piranha
Piranha - a modern cloud runtime
Stars: ✭ 136 (+257.89%)
Mutual labels:  container
tunneldigger
L2TPv3 VPN tunneling solution
Stars: ✭ 68 (+78.95%)
Mutual labels:  vpn

mullvadVPN Docker container

Image of Docker Image of Mullvad

Mullvad VPN container for docker. Example on how to setup Transmission with container at the bottom of the page.

Docker container that this relys on

Prerequisites

  • Docker installed (I'm using 19.03.8 Desktop on macOS)
  • Mullvad account (can be done with other providers, I completed with Mullvad)

Assuming environment is setup and you know drive mount locations.

Step 1: Getting Mullvad configuration .zip file

  1. Login to account on Mullvad.net
  2. Visit: OpenVPN configuration file generator on their website
  3. Select your favorite country and city within that country!
  4. Under advanced settings: toggle UDP 53
  5. Download zip archive, unarchive it into a regular folder, and place within a directory accessable by your Docker containers
  6. Return to My account and click Manage ports and WireGuard keys
  7. Next to a public key click the green +. This adds a port that will be used for configuring OpenVPN. REMEMBER THIS NUMBER FOR LATER :)

Step 2: Setup docker-compose file

---
version: "2"
services:
  openvpn-client:
    image: yacht7/openvpn-client            # Image on Docker. Shoutout to yacht7
    container_name: openvpn-client
    cap_add:
        - NET_ADMIN                         # Needs to be here
    environment: 
        - KILL_SWITCH=on                         # Turns off internet access if the VPN connection drops
        - FORWARDED_PORTS=5794                   # NUMBER TO REMEMBER FROM BEFORE, READ STEP 7 under STEP 1 (THIS IS CONFUSING AS IM TYPING IT, BUT READ IT)
        - SUBNETS=192.168.0.0/24,192.168.1.0/24  # Allows for the service to be accessed through LAN
    devices:
        - /dev/net/tun                      
    volumes:
        - /Volumes/Luigi/docker/mullvadVPN/config/mullvad_config_linux_ch_zrh:/data/vpn   
        # File unzipped before from Mullvad, it's location. Make sure to keep the ":/data/vpn" part at the end
    ports:
        - 5665:5665                         # Opening port for to access hypothetical Transmission container that would be routing through this VPN
        - 1500:1500                         # Opening port for other application routing through VPN
    restart: unless-stopped

Step 3: Confirming VPN connection is active within container

  1. cd into folder where the docker-compose.yml for this container is stored
  2. Awaken the beast with docker-compose up
  3. Let's get jiggy wit that sparkly new container:
    1. In a new terminal window, find docker container ID docker ps
    2. Type docker exec -it <container ID from above> /bin/sh
    3. Now that you're into the shell of your VPN container we're going to check it's public IP
    4. wget -qO- http://ipecho.net/plain | xargs echo will return your container's public IP
    5. Lookup this IP's information to see if it's the same country/city you seutp in your docker compose file. I'll let you find a site

Now go browse the internet from 🇨🇭Switzerland or somethin

Bonus section: Route other container's connection through this VPN

So you want to allow other containers to use this connection? Ok fine...

Add network_mode: container:openvpn-client to the container's compose file

Add ports: to the VPN's compose file

Hypothetical Transmission example

  1. Add network_mode: container:openvpn-client to docker compose file
  2. Make sure to add ports to VPN docker compose file, like in my example above
    1. These ports will be the ports required by the application running in the container you're routing through the VPN. Ex: 5665 would be to access the Transmission Web UI in this situation

version: "2.1"
services:
  transmission:
    image: linuxserver/transmission
    container_name: transmission
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Denver
    volumes:
      - <Config location>:/config
      - <Download location>:/downloads
      - <Watch location>:/watch
    network_mode: container:openvpn-client      # The addition to add to all containers that you want to route through VPN container
    restart: unless-stopped
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].