Skip to content

Latest commit

 

History

History
84 lines (63 loc) · 3.08 KB

README.md

File metadata and controls

84 lines (63 loc) · 3.08 KB

WireGuard + Traefik + Authelia

Docker Compose stack to deploy a WireGuard VPN server (wg-easy), Traefik as a reverse proxy to access the wg-easy UI, and Authelia for authentication.

WireGuard Logo        Traefik Logo        Authelia Logo        Watchtower Logo

Deploy

  1. Ensure Docker and Docker Compose plugin are installed.
  2. Generate password hash for users in Authelia
docker run --rm authelia/authelia:latest \
authelia crypto hash generate argon2 \
--password 'my-password'
  1. Update the Authelia users configuration in ./config/users_database.yml:
users:
  your-user-name:
    disabled: false
    displayname: "Your Disaplay Name"
    password: "<generated-password-hash>"
    email: "root@localhost"
  1. Obtain your DuckDNS token and export the following environmental variables:
export MY_PROVIDER="duckdns"
export MY_DOMAIN="mydomain.duckdns.org"
export DUCKDNS_TOKEN="MYTOKEN"
export PUID=$(id -u)
export PGID=$(id -g)

docker compose up -d
  1. Once the stack is up and running, go to your domain (${MY_DOMAIN}), log in with your password, and click register as shown below:

drawing

  1. After login, click "ADD" and it ask for OTP like below screenshot

drawing

  1. Retrieve the first 2FA code at config/notification.txt.

    NOTE: This config/notification.txt is automatically created by Authelia. For example:

    cat config/notification.txt
    Date: 2024-07-21 14:55:11.30894104 +0000 UTC m=+43.154509640
    Recipient: {Test User [email protected]}
    Subject: Confirm your identity
    Hi Test User,
    
    This email has been sent to you in order to validate your identity. Purpose: Confirm your identity.
    
    If you did not initiate the process, your credentials might have been compromised and you should:
        1. Visit the revocation link.
        2. Reset your password or other login credentials.
        3. Contact an Administrator.
    
    To confirm your identity, please use the following single-use code: TXQAT55T
    
    This email was generated by a user with the IP XXXXXX.
    
    The following link can be used to revoke the code (this is a logged event): XXXX
  2. Finally register the OTP in your favourite OTP App

drawing