{"id":23404756,"url":"https://github.com/nixern/wireguard-mullvadvpn","last_synced_at":"2026-04-29T15:01:29.774Z","repository":{"id":268553016,"uuid":"904720546","full_name":"nixern/wireguard-mullvadvpn","owner":"nixern","description":"Container with WireGuard and Mullvad VPN Config using SOCKS5, with tutorial","archived":false,"fork":false,"pushed_at":"2024-12-21T13:05:26.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T17:58:20.887Z","etag":null,"topics":["container","docker","mullvad","socks5-proxy-server","tutorial","vpn","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nixern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-17T12:32:09.000Z","updated_at":"2025-01-21T14:39:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"2cf17bd3-1a61-4d7a-ad11-a6a5d367bfb6","html_url":"https://github.com/nixern/wireguard-mullvadvpn","commit_stats":null,"previous_names":["nixern/wireguard-mullvadvpn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixern%2Fwireguard-mullvadvpn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixern%2Fwireguard-mullvadvpn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixern%2Fwireguard-mullvadvpn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixern%2Fwireguard-mullvadvpn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nixern","download_url":"https://codeload.github.com/nixern/wireguard-mullvadvpn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941717,"owners_count":21022037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","docker","mullvad","socks5-proxy-server","tutorial","vpn","wireguard"],"created_at":"2024-12-22T13:15:33.175Z","updated_at":"2026-04-29T15:01:24.755Z","avatar_url":"https://github.com/nixern.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker container with Wireguard and Mullvad VPN\n\n## Overview\n\n#### This container sets up a Mullvad WireGuard VPN and exposes a SOCKS5 proxy, so you can route traffic through Mullvad.  \n   \nI'm brand new to docker, and this is my first container (please be nice!).  \nThis is not a fully optimized container in any way - but a start.\n\n------\n#### About the image  \nBase image:  [Ubuntu](https://hub.docker.com/_/ubuntu/):20.04  \nExtra packages: wireguard-tools, iproute2, iptables, dante-server, curl, openresolv\n\n\n\n#### My build environment:\nDebian 12 VM (docker host)  \nDocker Compose version v2.31.0  \nGit version 2.39.5\nPortainer Standalone 27.4.0 for container management\n\n\n### Prerequisites\n* A valid Mullvad WireGuard configuration file. \n* Docker and Docker Compose installed. \n* Git - Not needed, but \"nice to have\". \n\n\n## Get started \n### Step 1: Generate and download the config file\n1.\tLog in to your account on [Mullvad.net](https://mullvad.net)\n2.\tOpen the [WireGuard configuration file generator](https://mullvad.net/en/account/wireguard-config)\n3.\tClick \"Generate a key\" and scroll to the bottom of the page.\n4.\tSelect a country, city and one server\n5.\tGenerate and download configuration -\u003e Download file\n6.\tRename to `wg0.conf` and put it where you map your container volume.\n\nEnsure that the file contains `[Interface]` and `[Peer]` settings.\n\n### Step 2: Get the files\n1. `cd` into the empty directory you want to store the sourcefiles.\n2. Clone this repo: `git clone https://github.com/nixern/wireguard-mullvad.git`\n3. Make sure you have all the files needed:\n\t```bash\n\t/projectdir/\n\t├─ docker-compose.yml\n\t├─ Dockerfile\n\t├─ dante.conf\n\t└─ start.sh\n\n\t./wg-configs/\n\t└─ wg0.conf\n\t```\n\n### Step 3: Configure docker-compose file\n```yaml\nservices:\n  wireguard-mullvad:\n    build: .\n    container_name: wireguard-mullvad\t# Name it whatever you like.\n    network_mode: \"host\"\t\t# Using host network creates a wg0 interface.\n    ports:\t\t\t\t# Remove ports if networkmode host is used.\n      - \"1080:1080\"\t\t\t# If you change the container port here, change port in dante.conf accordingly.\n    cap_add:\n      - NET_ADMIN\t\t\t# Required so container can manage network interfaces and routing on the host.\n    privileged: true\t\t\t# Same as above\n    volumes:\n      - ./wg-configs:/etc/wireguard \t# Location of your Mullvad WireGuard configuration file\n    environment:\n      - WG_CONFIG=wg0.conf\t\t# The name of your WireGuard config\n    restart: unless-stopped\n```\n\n### Step 4: Start it!\n1. `cd`to the directory with the source files\n2. Run `docker compose build`\n3. Run `docker compose up` or `docker compose up -d` for detached mode  \n\n### Step 5: Use it\nYou can now route your traffic through the SOCKS5 proxy:\n```\nProtocol: SOCKS v5\nSOCKS Host: Docker Host IP (or local dns name)\nSOCKS Port: 1080\n```\n\n\n\n## Confirming that VPN is connected:\n1.\tMake sure the container is listening on the specified port  \n\tOn the host, run: ```nmap -p1080 localhost```  \n    Expected output:\n\t```console\n\tPORT     STATE SERVICE\n\t1080/tcp open  socks\n\t```\n2. Set a browser to use SOCKS5 proxy and visit [Mullvad connection check](https://mullvad.net/en/check)  \n   Expected output: \"Using Mullvad VPN\"\n\n3. Check VPN connection inside the running container:  \nFind the name of the running container with `docker ps`.  \nRun curl command inside the container: `docker exec -it \u003ccontainername\u003e curl https://am.i.mullvad.net/connected`  \nIf the VPN connection is up, it outputs:\n```console\nYou are connected to Mullvad (server \"your vpn server choice\" ). Your IP address is \"your vpn ip\"\n```\n### Safe anonymous browsing!\n\n---\n\n### Things to improve\n* Add support for kill switch if VPN is down.\n* Slimmer base image! Currently 1.3GB :(\n* Add support for multiple vpn endpoint servers (multiple configs)\n* Run in its own docker network and let other containers use same network with `--network container: \u003cname|id\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixern%2Fwireguard-mullvadvpn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnixern%2Fwireguard-mullvadvpn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixern%2Fwireguard-mullvadvpn/lists"}