You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Khanh Ngo efbc36d61f
Update golang and alpine docker image tag (#209)
4 weeks ago
.github chore: update stale.yml 9 months ago
custom/js *: allows for BASE_PATH configuration (#183) 4 months ago
db Add empty db directory in vcs 2 years ago
emailer Remove From prefix from SMTP (#154) 6 months ago
handler Mitigate CSRF attacks (#206) 4 weeks ago
model Add environment variables for configuration (#189) 4 months ago
router Mitigate CSRF attacks (#206) 4 weeks ago
store Add environment variables for configuration (#189) 4 months ago
templates improve status UI (#196) 4 weeks ago
util Dont write FwMark if empty (#192) 4 months ago
.dockerignore Single binary build (#10) 2 years ago
.gitignore Single binary build (#10) 2 years ago
Dockerfile Update golang and alpine docker image tag (#209) 4 weeks ago
Jenkinsfile Create Jenkinsfile 8 months ago
LICENSE Create LICENSE 2 years ago Update screenshot (#203) 4 weeks ago
docker-compose.yaml Custom wg conf template (#179) 4 months ago
go.mod Add ForwardMark to global settings (#173) 4 months ago
go.sum Add ForwardMark to global settings (#173) 4 months ago
main.go Write the initial wireguard config on start, if none exists (#207) 4 weeks ago
package.json Add docker build 2 years ago I've modify the place where I inserted code to minimize the number of files touched. (#131) 8 months ago
yarn.lock Bump ssri from 8.0.0 to 8.0.1 (#51) 1 year ago


A web user interface to manage your WireGuard setup.


  • Friendly UI
  • Authentication
  • Manage extra client's information (name, email, etc)
  • Retrieve configs using QR code / file

Run WireGuard-UI

Default username and password are admin.

Using binary file

Download the binary file from the release and run it with command:


Using docker compose

You can take a look at this example of docker-compose.yml. Please adjust volume mount points to work with your setup. Then run it like below:

docker-compose up


  • There is a Status option that needs docker to be able to access the network of the host in order to read the wireguard interface stats. See the cap_add and network_mode options on the docker-compose.yaml
  • Because the network_mode is set to host, we don't need to specify the exposed ports. The app will listen on port 5000 by default.

Environment Variables

Variable Description
SESSION_SECRET Used to encrypt the session cookies. Set this to a random value.
WGUI_USERNAME The username for the login page. (default admin)
WGUI_PASSWORD The password for the user on the login page. (default admin)
WGUI_ENDPOINT_ADDRESS The default endpoint address used in global settings. (default is your public IP address)
WGUI_DNS The default DNS servers (comma-separated-list) used in the global settings. (default
WGUI_MTU The default MTU used in global settings. (default 1450)
WGUI_PERSISTENT_KEEPALIVE The default persistent keepalive for WireGuard in global settings. (default 15)
WGUI_FORWARD_MARK The default WireGuard forward mark. (default 0xca6c)
WGUI_CONFIG_FILE_PATH The default WireGuard config file path used in global settings. (default /etc/wireguard/wg0.conf)
BASE_PATH Set this variable if you run wireguard-ui under a subpath of your reverse proxy virtual host (e.g. /wireguard))

Defaults for server configuration

These environment variables are used to control the default server settings used when initializing the database.

Variable Description
WGUI_SERVER_INTERFACE_ADDRESSES The default interface addresses (comma-separated-list) for the WireGuard server configuration. (default
WGUI_SERVER_LISTEN_PORT The default server listen port. (default 51820)
WGUI_SERVER_POST_UP_SCRIPT The default server post-up script.
WGUI_SERVER_POST_DOWN_SCRIPT The default server post-down script.

Defaults for new clients

These environment variables are used to set the defaults used in New Client dialog.

Variable Description
WGUI_DEFAULT_CLIENT_ALLOWED_IPS Comma-separated-list of CIDRs for the Allowed IPs field. (default
WGUI_DEFAULT_CLIENT_EXTRA_ALLOWED_IPS Comma-separated-list of CIDRs for the Extra Allowed IPs field. (default empty)
WGUI_DEFAULT_CLIENT_USE_SERVER_DNS Boolean value [0, f, F, false, False, FALSE, 1, t, T, true, True, TRUE] (default true)
WGUI_DEFAULT_CLIENT_ENABLE_AFTER_CREATION Boolean value [0, f, F, false, False, FALSE, 1, t, T, true, True, TRUE] (default true)

Email configuration

To use custom wg.conf template set the WG_CONF_TEMPLATE environment variable to a path to such file. Make sure wireguard-ui will be able to work with it - use default template for reference.

In order to sent the wireguard configuration to clients via email, set the following environment variables:

  • using SendGrid API
SENDGRID_API_KEY: Your sendgrid api key
EMAIL_FROM_ADDRESS: the email address you registered on sendgrid
EMAIL_FROM_NAME: the sender's email address
  • using SMTP
SMTP_HOSTNAME: The SMTP ip address or hostname
SMTP_PORT: the SMTP port
SMTP_USERNAME: the SMTP username to authenticate
SMTP_PASSWORD: the SMTP user password
SMTP_AUTH_TYPE: the authentication type. Possible values: PLAIN, LOGIN, NONE
EMAIL_FROM_ADDRESS: the sender's email address
EMAIL_FROM_NAME: the sender's name

Auto restart WireGuard daemon

WireGuard-UI only takes care of configuration generation. You can use systemd to watch for the changes and restart the service. Following is an example:


Create /etc/systemd/system/wgui.service

Description=Restart WireGuard

ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service


Create /etc/systemd/system/wgui.path

Description=Watch /etc/wireguard/wg0.conf for changes



Apply it

systemctl enable wgui.{path,service}
systemctl start wgui.{path,service}


Create and chmod +x /usr/local/bin/wgui

wg-quick down wg0
wg-quick up wg0

Create and chmod +x /etc/init.d/wgui


command_args="/usr/local/bin/wgui /etc/wireguard/wg0.conf:w"

Apply it

rc-service wgui start
rc-update add wgui default


Build docker image

Go to the project root directory and run the following command:

docker build -t wireguard-ui .

Build binary file

Prepare the assets directory


Then you can embed resources by generating Go source code

rice embed-go
go build -o wireguard-ui

Or, append resources to executable as zip file

go build -o wireguard-ui
rice append --exec wireguard-ui


wireguard-ui 0.3.7




If you like the project and want to support it, you can buy me a coffee

Buy Me A Coffee