{"id":13471524,"url":"https://github.com/ngoduykhanh/wireguard-ui","last_synced_at":"2025-05-14T02:08:40.261Z","repository":{"id":38407144,"uuid":"256406208","full_name":"ngoduykhanh/wireguard-ui","owner":"ngoduykhanh","description":"Wireguard web interface","archived":false,"fork":false,"pushed_at":"2024-08-09T14:26:26.000Z","size":6877,"stargazers_count":4575,"open_issues_count":200,"forks_count":550,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-04-08T22:19:45.458Z","etag":null,"topics":["wireguard","wireguard-admin","wireguard-config-gen","wireguard-go","wireguard-ui","wireguard-vpn","wireguard-web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"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/ngoduykhanh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","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":["ngoduykhanh"]}},"created_at":"2020-04-17T05:05:36.000Z","updated_at":"2025-04-08T18:35:57.000Z","dependencies_parsed_at":"2024-06-18T15:25:32.986Z","dependency_job_id":"52755c24-816f-43c8-b54b-e41103cc7b50","html_url":"https://github.com/ngoduykhanh/wireguard-ui","commit_stats":{"total_commits":238,"total_committers":62,"mean_commits":3.838709677419355,"dds":0.5504201680672269,"last_synced_commit":"2fdafd34ca6c8f7f1415a3a1d89498bb575a7171"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngoduykhanh%2Fwireguard-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngoduykhanh%2Fwireguard-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngoduykhanh%2Fwireguard-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngoduykhanh%2Fwireguard-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngoduykhanh","download_url":"https://codeload.github.com/ngoduykhanh/wireguard-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254053180,"owners_count":22006717,"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":["wireguard","wireguard-admin","wireguard-config-gen","wireguard-go","wireguard-ui","wireguard-vpn","wireguard-web"],"created_at":"2024-07-31T16:00:46.219Z","updated_at":"2025-05-14T02:08:35.240Z","avatar_url":"https://github.com/ngoduykhanh.png","language":"Go","funding_links":["https://github.com/sponsors/ngoduykhanh","https://www.buymeacoffee.com/khanhngo"],"categories":["Go","Projects","others","[💾 sysadmin-devops](https://github.com/stars/ketsapiwiq/lists/sysadmin-devops)"],"sub_categories":["User Interface"],"readme":"![](https://github.com/ngoduykhanh/wireguard-ui/workflows/wireguard-ui%20build%20release/badge.svg)\n\n# wireguard-ui\n\nA web user interface to manage your WireGuard setup.\n\n## Features\n\n- Friendly UI\n- Authentication\n- Manage extra client information (name, email, etc.)\n- Retrieve client config using QR code / file / email / Telegram\n\n![wireguard-ui 0.3.7](https://user-images.githubusercontent.com/37958026/177041280-e3e7ca16-d4cf-4e95-9920-68af15e780dd.png)\n\n## Run WireGuard-UI\n\n\u003e ⚠️The default username and password are `admin`. Please change it to secure your setup.\n\n### Using binary file\n\nDownload the binary file from the release page and run it directly on the host machine\n\n```\n./wireguard-ui\n```\n\n### Using docker compose\n\nThe [examples/docker-compose](examples/docker-compose) folder contains example docker-compose files.\nChoose the example which fits you the most, adjust the configuration for your needs, then run it like below:\n\n```\ndocker-compose up\n```\n\n## Environment Variables\n\n| Variable                      | Description                                                                                                                                                                                                                                                                         | Default                            |\n|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|\n| `BASE_PATH`                   | Set this variable if you run wireguard-ui under a subpath of your reverse proxy virtual host (e.g. /wireguard)                                                                                                                                                                      | N/A                                |\n| `BIND_ADDRESS`                | The addresses that can access to the web interface and the port, use unix:///abspath/to/file.socket for unix domain socket.                                                                                                                                                         | 0.0.0.0:80                         |\n| `SESSION_SECRET`              | The secret key used to encrypt the session cookies. Set this to a random value                                                                                                                                                                                                      | N/A                                |\n| `SESSION_SECRET_FILE`         | Optional filepath for the secret key used to encrypt the session cookies. Leave `SESSION_SECRET` blank to take effect                                                                                                                                                               | N/A                                |\n| `SESSION_MAX_DURATION`        | Max time in days a remembered session is refreshed and valid. Non-refreshed session is valid for 7 days max, regardless of this setting.                                                                                                                                            | 90                                 |\n| `SUBNET_RANGES`               | The list of address subdivision ranges. Format: `SR Name:10.0.1.0/24; SR2:10.0.2.0/24,10.0.3.0/24` Each CIDR must be inside one of the server interfaces.                                                                                                                           | N/A                                |\n| `WGUI_USERNAME`               | The username for the login page. Used for db initialization only                                                                                                                                                                                                                    | `admin`                            |\n| `WGUI_PASSWORD`               | The password for the user on the login page. Will be hashed automatically. Used for db initialization only                                                                                                                                                                          | `admin`                            |\n| `WGUI_PASSWORD_FILE`          | Optional filepath for the user login password. Will be hashed automatically. Used for db initialization only. Leave `WGUI_PASSWORD` blank to take effect                                                                                                                            | N/A                                |\n| `WGUI_PASSWORD_HASH`          | The password hash for the user on the login page. (alternative to `WGUI_PASSWORD`). Used for db initialization only                                                                                                                                                                 | N/A                                |\n| `WGUI_PASSWORD_HASH_FILE`     | Optional filepath for the user login password hash. (alternative to `WGUI_PASSWORD_FILE`). Used for db initialization only. Leave `WGUI_PASSWORD_HASH` blank to take effect                                                                                                         | N/A                                |\n| `WGUI_ENDPOINT_ADDRESS`       | The default endpoint address used in global settings where clients should connect to. The endpoint can contain a port as well, useful when you are listening internally on the `WGUI_SERVER_LISTEN_PORT` port, but you forward on another port (ex 9000). Ex: myvpn.dyndns.com:9000 | Resolved to your public ip address |\n| `WGUI_FAVICON_FILE_PATH`      | The file path used as website favicon                                                                                                                                                                                                                                               | Embedded WireGuard logo            |\n| `WGUI_DNS`                    | The default DNS servers (comma-separated-list) used in the global settings                                                                                                                                                                                                          | `1.1.1.1`                          |\n| `WGUI_MTU`                    | The default MTU used in global settings                                                                                                                                                                                                                                             | `1450`                             |\n| `WGUI_PERSISTENT_KEEPALIVE`   | The default persistent keepalive for WireGuard in global settings                                                                                                                                                                                                                   | `15`                               |\n| `WGUI_FIREWALL_MARK`          | The default WireGuard firewall mark                                                                                                                                                                                                                                                 | `0xca6c`  (51820)                  |\n| `WGUI_TABLE`                  | The default WireGuard table value settings                                                                                                                                                                                                                                          | `auto`                             |\n| `WGUI_CONFIG_FILE_PATH`       | The default WireGuard config file path used in global settings                                                                                                                                                                                                                      | `/etc/wireguard/wg0.conf`          |\n| `WGUI_LOG_LEVEL`              | The default log level. Possible values: `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF`                                                                                                                                                                                                     | `INFO`                             |\n| `WG_CONF_TEMPLATE`            | The custom `wg.conf` config file template. Please refer to our [default template](https://github.com/ngoduykhanh/wireguard-ui/blob/master/templates/wg.conf)                                                                                                                        | N/A                                |\n| `EMAIL_FROM_ADDRESS`          | The sender email address                                                                                                                                                                                                                                                            | N/A                                |\n| `EMAIL_FROM_NAME`             | The sender name                                                                                                                                                                                                                                                                     | `WireGuard UI`                     |\n| `SENDGRID_API_KEY`            | The SendGrid api key                                                                                                                                                                                                                                                                | N/A                                |\n| `SENDGRID_API_KEY_FILE`       | Optional filepath for the SendGrid api key. Leave `SENDGRID_API_KEY` blank to take effect                                                                                                                                                                                           | N/A                                |\n| `SMTP_HOSTNAME`               | The SMTP IP address or hostname                                                                                                                                                                                                                                                     | `127.0.0.1`                        |\n| `SMTP_PORT`                   | The SMTP port                                                                                                                                                                                                                                                                       | `25`                               |\n| `SMTP_USERNAME`               | The SMTP username                                                                                                                                                                                                                                                                   | N/A                                |\n| `SMTP_PASSWORD`               | The SMTP user password                                                                                                                                                                                                                                                              | N/A                                |\n| `SMTP_PASSWORD_FILE`          | Optional filepath for the SMTP user password. Leave `SMTP_PASSWORD` blank to take effect                                                                                                                                                                                            | N/A                                |\n| `SMTP_AUTH_TYPE`              | The SMTP authentication type. Possible values: `PLAIN`, `LOGIN`, `NONE`                                                                                                                                                                                                             | `NONE`                             |\n| `SMTP_ENCRYPTION`             | The encryption method. Possible values: `NONE`, `SSL`, `SSLTLS`, `TLS`, `STARTTLS`                                                                                                                                                                                                  | `STARTTLS`                         |\n| `SMTP_HELO`                   | Hostname to use for the HELO message. smtp-relay.gmail.com needs this set to anything but `localhost`                                                                                                                                                                               | `localhost`                        |\n| `TELEGRAM_TOKEN`              | Telegram bot token for distributing configs to clients                                                                                                                                                                                                                              | N/A                                |\n| `TELEGRAM_ALLOW_CONF_REQUEST` | Allow users to get configs from the bot by sending a message                                                                                                                                                                                                                        | `false`                            |\n| `TELEGRAM_FLOOD_WAIT`         | Time in minutes before the next conf request is processed                                                                                                                                                                                                                           | `60`                               |\n\n### Defaults for server configuration\n\nThese environment variables are used to control the default server settings used when initializing the database.\n\n| Variable                          | Description                                                                                   | Default         |\n|-----------------------------------|-----------------------------------------------------------------------------------------------|-----------------|\n| `WGUI_SERVER_INTERFACE_ADDRESSES` | The default interface addresses (comma-separated-list) for the WireGuard server configuration | `10.252.1.0/24` |\n| `WGUI_SERVER_LISTEN_PORT`         | The default server listen port                                                                | `51820`         |\n| `WGUI_SERVER_POST_UP_SCRIPT`      | The default server post-up script                                                             | N/A             |\n| `WGUI_SERVER_POST_DOWN_SCRIPT`    | The default server post-down script                                                           | N/A             |\n\n### Defaults for new clients\n\nThese environment variables are used to set the defaults used in `New Client` dialog.\n\n| Variable                                    | Description                                                                                     | Default     |\n|---------------------------------------------|-------------------------------------------------------------------------------------------------|-------------|\n| `WGUI_DEFAULT_CLIENT_ALLOWED_IPS`           | Comma-separated-list of CIDRs for the `Allowed IPs` field. (default )                           | `0.0.0.0/0` |\n| `WGUI_DEFAULT_CLIENT_EXTRA_ALLOWED_IPS`     | Comma-separated-list of CIDRs for the `Extra Allowed IPs` field. (default empty)                | N/A         |\n| `WGUI_DEFAULT_CLIENT_USE_SERVER_DNS`        | Boolean value [`0`, `f`, `F`, `false`, `False`, `FALSE`, `1`, `t`, `T`, `true`, `True`, `TRUE`] | `true`      |\n| `WGUI_DEFAULT_CLIENT_ENABLE_AFTER_CREATION` | Boolean value [`0`, `f`, `F`, `false`, `False`, `FALSE`, `1`, `t`, `T`, `true`, `True`, `TRUE`] | `true`      |\n\n### Docker only\n\nThese environment variables only apply to the docker container.\n\n| Variable              | Description                                                   | Default |\n|-----------------------|---------------------------------------------------------------|---------|\n| `WGUI_MANAGE_START`   | Start/stop WireGuard when the container is started/stopped    | `false` |\n| `WGUI_MANAGE_RESTART` | Auto restart WireGuard when we Apply Config changes in the UI | `false` |\n\n## Auto restart WireGuard daemon\n\nWireGuard-UI only takes care of configuration generation. You can use systemd to watch for the changes and restart the\nservice. Following is an example:\n\n### Using systemd\n\nCreate `/etc/systemd/system/wgui.service`\n\n```bash\ncd /etc/systemd/system/\ncat \u003c\u003c EOF \u003e wgui.service\n[Unit]\nDescription=Restart WireGuard\nAfter=network.target\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/systemctl restart wg-quick@wg0.service\n\n[Install]\nRequiredBy=wgui.path\nEOF\n```\n\nCreate `/etc/systemd/system/wgui.path`\n\n```bash\ncd /etc/systemd/system/\ncat \u003c\u003c EOF \u003e wgui.path\n[Unit]\nDescription=Watch /etc/wireguard/wg0.conf for changes\n\n[Path]\nPathModified=/etc/wireguard/wg0.conf\n\n[Install]\nWantedBy=multi-user.target\nEOF\n```\n\nApply it\n\n```sh\nsystemctl enable wgui.{path,service}\nsystemctl start wgui.{path,service}\n```\n\n### Using openrc\n\nCreate `/usr/local/bin/wgui` file and make it executable\n\n```sh\ncd /usr/local/bin/\ncat \u003c\u003c EOF \u003e wgui\n#!/bin/sh\nwg-quick down wg0\nwg-quick up wg0\nEOF\nchmod +x wgui\n```\n\nCreate `/etc/init.d/wgui` file and make it executable\n\n```sh\ncd /etc/init.d/\ncat \u003c\u003c EOF \u003e wgui\n#!/sbin/openrc-run\n\ncommand=/sbin/inotifyd\ncommand_args=\"/usr/local/bin/wgui /etc/wireguard/wg0.conf:w\"\npidfile=/run/${RC_SVCNAME}.pid\ncommand_background=yes\nEOF\nchmod +x wgui\n```\n\nApply it\n\n```sh\nrc-service wgui start\nrc-update add wgui default\n```\n\n### Using Docker\n\nSet `WGUI_MANAGE_RESTART=true` to manage Wireguard interface restarts.\nUsing `WGUI_MANAGE_START=true` can also replace the function of `wg-quick@wg0` service, to start Wireguard at boot, by\nrunning the container with `restart: unless-stopped`. These settings can also pick up changes to Wireguard Config File\nPath, after restarting the container. Please make sure you have `--cap-add=NET_ADMIN` in your container config to make\nthis feature work.\n\n## Build\n\n### Build docker image\n\nGo to the project root directory and run the following command:\n\n```sh\ndocker build --build-arg=GIT_COMMIT=$(git rev-parse --short HEAD) -t wireguard-ui .\n```\n\nor\n\n```sh\ndocker compose build --build-arg=GIT_COMMIT=$(git rev-parse --short HEAD)\n```\n\n:information_source: A container image is available on [Docker Hub](https://hub.docker.com/r/ngoduykhanh/wireguard-ui)\nwhich you can pull and use\n\n```\ndocker pull ngoduykhanh/wireguard-ui\n````\n\n### Build binary file\n\nPrepare the assets directory\n\n```sh\n./prepare_assets.sh\n```\n\nThen build your executable\n\n```sh\ngo build -o wireguard-ui\n```\n\n## License\n\nMIT. See [LICENSE](https://github.com/ngoduykhanh/wireguard-ui/blob/master/LICENSE).\n\n## Support\n\nIf you like the project and want to support it, you can *buy me a coffee* ☕\n\n\u003ca href=\"https://www.buymeacoffee.com/khanhngo\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngoduykhanh%2Fwireguard-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngoduykhanh%2Fwireguard-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngoduykhanh%2Fwireguard-ui/lists"}