{"id":16182577,"url":"https://github.com/jippi/docker-pritunl","last_synced_at":"2025-04-12T18:50:34.323Z","repository":{"id":51323470,"uuid":"85802275","full_name":"jippi/docker-pritunl","owner":"jippi","description":"Pritunl on Docker","archived":false,"fork":false,"pushed_at":"2025-02-04T17:28:41.000Z","size":130,"stargazers_count":202,"open_issues_count":1,"forks_count":64,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T22:07:27.593Z","etag":null,"topics":["docker","pritunl","vpn","vpn-server"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/jippi/pritunl/","language":"Shell","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/jippi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["jippi"]}},"created_at":"2017-03-22T08:16:53.000Z","updated_at":"2025-04-01T16:54:50.000Z","dependencies_parsed_at":"2023-01-31T19:15:49.579Z","dependency_job_id":"8f4e7bcc-d808-4add-bbfc-a85e3448b7c4","html_url":"https://github.com/jippi/docker-pritunl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jippi%2Fdocker-pritunl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jippi%2Fdocker-pritunl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jippi%2Fdocker-pritunl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jippi%2Fdocker-pritunl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jippi","download_url":"https://codeload.github.com/jippi/docker-pritunl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618222,"owners_count":21134199,"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":["docker","pritunl","vpn","vpn-server"],"created_at":"2024-10-10T06:34:19.320Z","updated_at":"2025-04-12T18:50:34.303Z","avatar_url":"https://github.com/jippi.png","language":"Shell","funding_links":["https://github.com/sponsors/jippi"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\"\u003e\n   English\u0026nbsp ｜\u0026nbsp \u003ca href=\"README_CN.md\"\u003e中文\u003c/a\u003e\n\u003c/p\u003e\n\n# Pritunl as a Docker container\n\n\u003e Pritunl is the best open source alternative to proprietary commercial vpn products such as Aviatrix and Pulse Secure. Create larger cloud vpn networks supporting thousands of concurrent users and get more control over your vpn server without any per-user pricing.\n\n## Images\n\nAll images are published to the following registries\n\n* 🥇 [GitHub](https://github.com/jippi/docker-pritunl/pkgs/container/docker-pritunl) as `ghcr.io/jippi/docker-pritunl` ⬅️ **Recommended**\n* 🥈 [AWS](https://gallery.ecr.aws/jippi/pritunl) as `public.ecr.aws/jippi/pritunl` ⬅️ Great alternative\n* ⚠️ [Docker Hub](https://hub.docker.com/r/jippi/pritunl/) as `jippi/docker-pritunl` ⬅️ Only use `:latest` as [tags might disappear](https://www.docker.com/blog/scaling-dockers-business-to-serve-millions-more-developers-storage/)\n\nImage tags with software specifications and version information can be found in the table below\n\n| **Tag**                   | **Version**                                                     | **OS (Ubuntu)**         | **MongoDB**            | **Wireguard**             |\n|-------------------------- |---------------------------------------------------------------- |-----------------------  |:---------------------: |:------------------------: |\n| `latest`                  | [latest †](https://github.com/pritunl/pritunl/releases/latest)  | Jammy (22.04)           |        ✅ (6.x)         |            ✅             |\n| `latest-minimal`          | [latest †](https://github.com/pritunl/pritunl/releases/latest)  | Jammy (22.04)           |           ❌            |            ✅             |\n| `latest-focal`            | [latest †](https://github.com/pritunl/pritunl/releases/latest)  | Focal (20.04)           |        ✅ (5.x)         |            ✅             |\n| `latest-focal-minimal`    | [latest †](https://github.com/pritunl/pritunl/releases/latest)  | Focal (20.04)           |           ❌            |            ✅             |\n| `$version`                | `$version`                                                      | Jammy (22.04)           |        ✅ (6.x)         |            ✅             |\n| `$version-minimal`        | `$version`                                                      | Jammy (22.04)           |           ❌            |            ✅             |\n| `$version-focal`          | `$version`                                                      | Focal (20.04)           |        ✅ (5.x)         |            ✅             |\n| `$version-focal-minimal`  | `$version`                                                      | Focal (20.04)           |           ❌            |            ✅             |\n\n_† Automation checks for new Pritunl releases nightly (CEST, ~3am), so there might be a day or two latency for most recent release_\n\n## Default user and password\n\nRun the following command to obtain the default login username and password:\n\n```sh\ndocker exec -it [container_name] pritunl default-password\n```\n\nEx:\n\n```sh\ndocker exec -it pritunl pritunl default-password\n```\n\n## Config\n\nConfiguration settings that can be used via `--env` / `-e` CLI flag in `docker run`.\n\n* `PRITUNL_DONT_WRITE_CONFIG` if set, `/etc/pritunl.conf` will not be auto-written on container start. _Any_ value will stop modifying the configuration file.\n* `PRITUNL_DEBUG` must be `true` or `false` - controls the `debug` config key.\n* `PRITUNL_BIND_ADDR` must be a valid IP on the host - defaults to `0.0.0.0` - controls the `bind_addr` config key.\n* `PRITUNL_MONGODB_URI` URI to mongodb instance, default is starting a local MongoDB instance inside the container. _Any_ value will stop this behavior.\n\n## Usage with embedded MongoDB\n\nI would recommend using a Docker `volume` or `bind` mount for persistent data like shown in the examples below\n\n### docker run (with mongo)\n\n```sh\ndata_dir=$(pwd)/data\n\nmkdir -p $(data_dir)/pritunl $(data_dir)/mongodb\ntouch $(data_dir)/pritunl.conf\n\ndocker run \\\n    --name pritunl \\\n    --privileged \\\n    --network=host \\\n    --dns 127.0.0.1 \\\n    --restart=unless-stopped \\\n    --detach \\\n    --volume $(data_dir)/pritunl.conf:/etc/pritunl.conf \\\n    --volume $(data_dir)/pritunl:/var/lib/pritunl \\\n    --volume $(data_dir)/mongodb:/var/lib/mongodb \\\n    ghcr.io/jippi/docker-pritunl\n```\n\n### docker-compose (with mongo)\n\n```sh\ndata_dir=$(pwd)/data\n\nmkdir -p $(data_dir)/pritunl $(data_dir)/mongodb\ntouch $(data_dir)/pritunl.conf\n```\n\nand then the following `docker-compose.yaml` file in `$(pwd)` followed by `docker-compose up -d`\n\n```yaml\nversion: '3.3'\nservices:\n    pritunl:\n        container_name: pritunl\n        image: ghcr.io/jippi/docker-pritunl\n        restart: unless-stopped\n        privileged: true\n        network_mode: host\n        dns:\n            - 127.0.0.1\n        volumes:\n            - './data/pritunl.conf:/etc/pritunl.conf'\n            - './data/pritunl:/var/lib/pritunl'\n            - './data/mongodb:/var/lib/mongodb'\n```\n\n## Usage without embedded MongoDB\n\nI would recommend using a Docker `volume` or `bind` mount for persistent data like shown in the examples below\n\nIf you have MongoDB running somewhere else you'd like to use, you can do so through the `PRITUNL_MONGODB_URI` env var like shown below\n\n### docker run (without mongo)\n\n```sh\ndata_dir=$(pwd)/data\n\nmkdir -p $(data_dir)/pritunl\ntouch $(data_dir)/pritunl.conf\n\ndocker run \\\n    --name pritunl \\\n    --privileged \\\n    --network=host \\\n    --dns 127.0.0.1 \\\n    --restart=unless-stopped \\\n    --detach \\\n    --volume $(data_dir)/pritunl.conf:/etc/pritunl.conf \\\n    --volume $(data_dir)/pritunl:/var/lib/pritunl \\\n    --env PRITUNL_MONGODB_URI=mongodb://some-mongo-host:27017/pritunl \\\n    ghcr.io/jippi/docker-pritunl\n```\n\n### docker-compose (without mongo)\n\n```sh\ndata_dir=$(pwd)/data\n\nmkdir -p $(data_dir)/pritunl\ntouch $(data_dir)/pritunl.conf\n```\n\nand then the following `docker-compose.yaml` file in `$(pwd)` followed by `docker-compose up -d`\n\n```yaml\nversion: '3.3'\nservices:\n    pritunl:\n        container_name: pritunl\n        image: ghcr.io/jippi/docker-pritunl\n        restart: unless-stopped\n        privileged: true\n        network_mode: host\n        dns:\n            - 127.0.0.1\n        environment:\n            - PRITUNL_MONGODB_URI=mongodb://some-mongo-host:27017/pritunl\n        volumes:\n            - './data/pritunl.conf:/etc/pritunl.conf'\n            - './data/pritunl:/var/lib/pritunl'\n```\n\n## Network mode\n\nIf you don't want to use `network=host`, then replace the `--network=host` CLI flag with the following ports + any ports you need for your configured Pritunl servers.\n\n```sh\n    --publish 80:80 \\\n    --publish 443:443 \\\n    --publish 1194:1194 \\\n    --publish 1194:1194/udp \\\n```\n\nor for `docker-compose`\n\n```yaml\n         ports:\n            - '80:80'\n            - '443:443'\n            - '1194:1194'\n            - '1194:1194/udp'\n```\n\n## Upgrading MongoDB\n\n**IMPORTANT**: Stop your `pritunl` docker container (`docker stop pritunl`) before doing these steps\n\nThe pattern for upgrading are basically the same, with the only variance being the MongoDB version number, the docs can be found here:\n\n* [Upgrade from 3.2 to 3.6](https://www.mongodb.com/docs/manual/release-notes/3.6-upgrade-standalone/#prerequisites)\n* [Upgrade from 3.6 to 4.0](https://www.mongodb.com/docs/manual/release-notes/4.0-upgrade-standalone/#prerequisites)\n* [Upgrade from 4.0 to 4.2](https://www.mongodb.com/docs/manual/release-notes/4.2-upgrade-standalone/#prerequisites)\n* [Upgrade from 4.2 to 4.4](https://www.mongodb.com/docs/manual/release-notes/4.4-upgrade-standalone/#prerequisites) \u003c- stop here if you use `Bionic (18.04)`\n* [Upgrade from 4.4 to 5.0](https://www.mongodb.com/docs/manual/release-notes/5.0-upgrade-standalone/#prerequisites) \u003c- stop here if you use `Focal (20.04)`\n\n### Automated script\n\nI've made a small script called [mongo-upgrade.sh](https://github.com/jippi/docker-pritunl/blob/master/mongo-upgrade.sh) that you can download to your server and run. It will make an best-effort to guide you through the steps needed to upgrade.\n\n```sh\n# fetch the script\nwget -O mongo-upgrade.sh https://raw.githubusercontent.com/jippi/docker-pritunl/master/mongo-upgrade.sh\n# make it executable\nchmod +x mongo-upgrade.sh\n# edit settings\nvi mongo-upgrade.sh\n# run\n./mongo-upgrade.sh\n```\n\n### Manual upgrade\n\nAssuming you are coming from `3.2`, your next version is `3.6` so you need to set `$NEXT_VERSION_TO_UPGRADE_TO=3.6` and run these commands.\n\nYou can see the list of versions you would need to run with the script above.\n\nExample path from `3.2` to `4.4` would mean running the script once per `NEXT_VERSION_TO_UPGRADE_TO` with the values below\n\n* `NEXT_VERSION_TO_UPGRADE_TO=3.2`\n* `NEXT_VERSION_TO_UPGRADE_TO=3.6`\n* `NEXT_VERSION_TO_UPGRADE_TO=4.0`\n* `NEXT_VERSION_TO_UPGRADE_TO=4.2`\n* `NEXT_VERSION_TO_UPGRADE_TO=4.4`\n\n```sh\nNEXT_VERSION_TO_UPGRADE_TO=\nMONGODB_DATA_PATH=$PATH_TO_YOUR_MONGODB_DB_FOLDER # must point to the directory where files like `mongod.lock` and `journal/` are on disk.\n\n# Start MongoDB server\ndocker run -d --name temp-mongo-server --rm -it -v ${MONGODB_DATA_PATH}:/data/db mongo:${NEXT_VERSION_TO_UPGRADE_TO}\n\n# Wait for server to start\nsleep 5\n\n# change setFeatureCompatibilityVersion to current version\ndocker exec temp-mongo-server mongo admin --quiet --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"${NEXT_VERSION_TO_UPGRADE_TO}\\\" } );\"\n\n# stop the server gracefully\ndocker exec -it temp-mongo-server mongo admin --quiet --eval \"db.shutdownServer()\"\n\n# Wait for the server to stop\nsleep 5\n\n# make sure container is stopped\ndocker stop temp-mongo-server\n\n# remove container\ndocker rm -f temp-mongo-server\n\n# repair / upgrade data\ndocker run --rm --volume ${MONGODB_DATA_PATH}:/data/db mongo:${NEXT_VERSION_TO_UPGRADE_TO} --repair\n```\n\n## Further help and docs\n\nFor any help specific to Pritunl please have a look at \u003chttp://pritunl.com\u003e and \u003chttps://github.com/pritunl/pritunl\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjippi%2Fdocker-pritunl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjippi%2Fdocker-pritunl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjippi%2Fdocker-pritunl/lists"}