Authelia with Let's Encrypt Using Docker Compose

Deployment Verification

The badge displayed on my repository indicates the status of the deployment verification workflow as executed on the latest commit to the main branch.

Passing: This means the most recent commit has successfully passed all deployment checks, confirming that the Docker Compose setup functions correctly as designed.

๐Ÿ“™ The complete installation guide is available on my website.

โ— Create secret for storing Authelia using the command:

chmod +x generate-authelia-secrets.sh && ./generate-authelia-secrets.sh

โ— Change variables in the .env, config/configuration.yml, and config/users_database.yml files to meet your requirements.

โ— Update the SMTP settings in config/configuration.yml to ensure Authelia functions properly. Authelia relies on these settings for sending email notifications for password resets, two-factor authentication setups, and more.

๐Ÿ’ก Note that the .env file should be in the same directory as authelia-traefik-letsencrypt-docker-compose.yml.

Create networks for your services before deploying the configuration using the commands:

docker network create traefik-network

docker network create authelia-network

Deploy Authelia using Docker Compose:

docker compose -f authelia-traefik-letsencrypt-docker-compose.yml -p authelia up -d

Enabling Authelia with Traefik

To integrate Authelia for authentication in your container services managed by Traefik, follow the steps below. This will ensure secure access by requiring authentication through Authelia.

Step 1: Add Authelia Middleware

Add the following label to your container configuration to enable Authelia. Replace your-router-name with the name of your specific router:

- "traefik.http.routers.your-router-name.middlewares=authelia@docker"

Example

If you are enabling Authelia on a service called "whoami", the label would look like this:

- "traefik.http.routers.whoami.middlewares=authelia@docker"

Step 2: Adjust for Existing Middlewares

If your service already uses other middlewares, append authelia@docker to the existing list, separated by a comma:

- "traefik.http.routers.your-router-name.middlewares=existing-middleware,authelia@docker"

Author

Iโ€™m Vladimir Mikhalev, the Docker Captain, but my friends can call me Valdemar.

๐ŸŒ My website with detailed IT guides
๐ŸŽฌ Follow me on YouTube
๐Ÿฆ Follow me on Twitter
๐ŸŽจ Follow me on Instagram
๐Ÿงต Follow me on Threads
๐Ÿ˜ Follow me on Mastodon
๐ŸงŠ Follow me on Bluesky
๐ŸŽธ Follow me on Facebook
๐ŸŽฅ Follow me on TikTok
๐Ÿ’ป Follow me on LinkedIn
๐Ÿˆ Follow me on GitHub

Communication

๐Ÿ‘พ Chat with IT pros on Discord
๐Ÿ“ง Reach me at ask@sre.gg

Give Thanks

๐Ÿ’Ž Support on GitHub
๐Ÿ† Support on Patreon
๐Ÿฅค Support on BuyMeaCoffee
๐Ÿช Support on Ko-fi
๐Ÿ’– Support on PayPal