{"id":18746076,"url":"https://github.com/fscm/docker-pritunl","last_synced_at":"2025-04-12T21:33:32.349Z","repository":{"id":202050252,"uuid":"172539558","full_name":"fscm/docker-pritunl","owner":"fscm","description":"Docker recipe to build a Pritunl image","archived":false,"fork":false,"pushed_at":"2022-01-03T15:59:09.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T16:11:26.429Z","etag":null,"topics":["docker","docker-image","dockerfile","openvpn","pritunl"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fscm.png","metadata":{"files":{"readme":"README.build.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-02-25T16:12:51.000Z","updated_at":"2024-04-02T14:38:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa6493b8-bb56-4920-bbba-0f81c511655f","html_url":"https://github.com/fscm/docker-pritunl","commit_stats":null,"previous_names":["fscm/docker-pritunl"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fscm%2Fdocker-pritunl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fscm%2Fdocker-pritunl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fscm%2Fdocker-pritunl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fscm%2Fdocker-pritunl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fscm","download_url":"https://codeload.github.com/fscm/docker-pritunl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636671,"owners_count":21137503,"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","docker-image","dockerfile","openvpn","pritunl"],"created_at":"2024-11-07T16:20:48.702Z","updated_at":"2025-04-12T21:33:28.229Z","avatar_url":"https://github.com/fscm.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pritunl for Docker\n\nDocker image with Pritunl.\n\n## Synopsis\n\nThis script will create a Docker image with Pritunl installed and with all\nof the required initialization scripts.\n\nThe Docker image resulting from this script should be the one used to\ninstantiate a Pritunl server.\n\n## Getting Started\n\nThere are a couple of things needed for the script to work.\n\n### Prerequisites\n\nDocker, either the Community Edition (CE) or Enterprise Edition (EE), needs to\nbe installed on your local computer.\n\n#### Docker\n\nDocker installation instructions can be found\n[here](https://docs.docker.com/install/).\n\n### Usage\n\nIn order to create a Docker image using this Dockerfile you need to run the\n`docker` command with a few options.\n\n```\ndocker image build --force-rm --no-cache --quiet --tag \u003cUSER\u003e/\u003cIMAGE\u003e:\u003cTAG\u003e \u003cPATH\u003e\n```\n\n* `\u003cUSER\u003e` - *[required]* The user that will own the container image (e.g.: \"johndoe\").\n* `\u003cIMAGE\u003e` - *[required]* The container name (e.g.: \"pritunl\").\n* `\u003cTAG\u003e` - *[required]* The container tag (e.g.: \"latest\").\n* `\u003cPATH\u003e` - *[required]* The location of the Dockerfile folder.\n\nA build example:\n\n```\ndocker image build --force-rm --no-cache --quiet --tag johndoe/my_pritunl:latest .\n```\n\nTo clean any _\u003cnone\u003e_ image(s) left by the build process the following\ncommand can be used:\n\n```\ndocker image rm `docker image ls --filter \"dangling=true\" --quiet`\n```\n\nYou can also use the following command to achieve the same result:\n\n```\ndocker image prune -f\n```\n\n### Instantiate a Container\n\nIn order to end up with a functional Pritunl service - after having build\nthe container - some configurations have to be performed.\n\nTo help perform those configurations a small set of commands is included on the\nDocker container.\n\n- `help` - Usage help.\n- `init` - Configure the Pritunl service.\n- `start` - Start the Pritunl service.\n\nTo store the configuration settings of the Pritunl server as well as the users\ninformation a volume should be created and added to the container when running\nthe same.\n\n#### Creating Volumes\n\nTo be able to make all of the Pritunl data persistent, the same will have to\nbe stored on a different volume.\n\nCreating volumes can be done using the `docker` tool. To create a volume use\nthe following command:\n\n```\ndocker volume create --name \u003cVOLUME_NAME\u003e\n```\n\nTo create the required volume the following command can be used:\n\n```\ndocker volume create --name my_pritunl\n```\n\n**Note:** A local folder can also be used instead of a volume. Use the path of\nthe folder in place of the volume name.\n\n#### Configuring the Pritunl Server\n\nTo configure the Pritunl server the `init` command must be used.\n\n```\ndocker container run --volume \u003cPRITUNL_VOL\u003e:/data:rw --rm \u003cUSER\u003e/\u003cIMAGE\u003e:\u003cTAG\u003e [options] init\n```\n\n* `-m \u003cURI\u003e` - *[required]* The MongoDB URI (e.g.: mongodb://mongodb.host:27017/pritunl).\n\nAfter this step the Pritunl server should be configured and ready to use.\n\nAn example on how to configure the Pritunl server:\n\n```\ndocker container run --volume my_pritunl:/data:rw --rm johndoe/my_pritunl:latest -m mongodb://mongodb:27017/pritunl init\n```\n\n**Note:** This command will output the **SetupKey** and the default\n**Administrator credentials**. Take note of those for later use on the service\nweb interface.\n\n#### Start the Pritunl Server\n\nAfter configuring the Pritunl server the same can now be started.\n\nStarting the Pritunl server can be done with the `start` command.\n\n```\ndocker container run --volume \u003cPRITUNL_VOL\u003e:/data/pritunl:rw --detach --publish 1194:1194/udp --publish 1194:1194 --publish 443:443 --publish 80:80 --privileged --device=/dev/net/tun \u003cUSER\u003e/\u003cIMAGE\u003e:\u003cTAG\u003e start\n```\n\nThe Docker options `--privileged` and`--device=/dev/net/tun` are required for\nthe container to be able to start.\n\nTo help managing the container and the Pritunl instance a name can be given to\nthe container. To do this use the `--name \u003cNAME\u003e` docker option when starting\nthe server   \n\nAn example on how the Pritunl service can be started:\n\n```\ndocker container run --volume my_pritunl:/data/pritunl:rw --detach --publish 1194:1194/udp --publish 1194:1194 --publish 443:443 --publish 80:80 --privileged --device=/dev/net/tun --name my_pritunl johndoe/my_pritunl:latest start\n```\n\nTo see the output of the container that was started use the following command:\n\n```\ndocker container attach \u003cCONTAINER_ID\u003e\n```\n\nUse the `ctrl+p` `ctrl+q` command sequence to detach from the container.\n\n#### Stop the Pritunl Server\n\nIf needed the Pritunl server can be stoped and later started again (as long as\nthe command used to perform the initial start was as indicated before).\n\nTo stop the server use the following command:\n\n```\ndocker container stop \u003cCONTAINER_ID\u003e\n```\n\nTo start the server again use the following command:\n\n```\ndocker container start \u003cCONTAINER_ID\u003e\n```\n\n### Pritunl Status\n\nThe Pritunl server status can be check by looking at the Pritunl server output\ndata using the docker command:\n\n```\ndocker container logs \u003cCONTAINER_ID\u003e\n```\n\n### Add Tags to the Docker Image\n\nAdditional tags can be added to the image using the following command:\n\n```\ndocker image tag \u003cimage_id\u003e \u003cuser\u003e/\u003cimage\u003e:\u003cextra_tag\u003e\n```\n\n### Push the image to Docker Hub\n\nAfter adding an image to Docker, that image can be pushed to a Docker\nregistry... Like Docker Hub.\n\nMake sure that you are logged in to the service.\n\n```\ndocker login\n```\n\nWhen logged in, an image can be pushed using the following command:\n\n```\ndocker image push \u003cuser\u003e/\u003cimage\u003e:\u003ctag\u003e\n```\n\nExtra tags can also be pushed.\n\n```\ndocker image push \u003cuser\u003e/\u003cimage\u003e:\u003cextra_tag\u003e\n```\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request\n\nPlease read the [CONTRIBUTING.md](CONTRIBUTING.md) file for more details on how\nto contribute to this project.\n\n## Versioning\n\nThis project uses [SemVer](http://semver.org/) for versioning. For the versions\navailable, see the [tags on this repository](https://github.com/fscm/docker-pritunl/tags).\n\n## Authors\n\n* **Frederico Martins** - [fscm](https://github.com/fscm)\n\nSee also the list of [contributors](https://github.com/fscm/docker-pritunl/contributors)\nwho participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE)\nfile for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffscm%2Fdocker-pritunl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffscm%2Fdocker-pritunl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffscm%2Fdocker-pritunl/lists"}