From e38df023ad0ba8b25cf365a4ff9f10530192b6fd Mon Sep 17 00:00:00 2001 From: Outis Date: Mon, 1 Jun 2026 09:46:14 -0400 Subject: [PATCH] Update README for Docker network and Caddyfile instructions Clarify instructions for Docker network and Caddyfile snippet placement. --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc16d57..83d6414 100644 --- a/README.md +++ b/README.md @@ -72,11 +72,18 @@ docker run --rm authelia/authelia:4.39.20 authelia crypto hash generate argon2 - ``` Paste the output into `users.yml` for each user. Tell users to use "Forgot Password" on first login to set their own. -### 6. Create Docker network +### 6. Create or verify Docker network +If Caddy is already running with an existing network, find its name and use that instead: ```bash -docker network create caddy_net +docker network ls ``` +If the network doesn't exist yet, create it: +```bash +docker network create caddy_net``` + +Update `DOCKER_MY_NETWORK` in `authelia/.env` to match. + ### 7. Start Authelia ```bash cd ~/docker/authelia @@ -87,6 +94,9 @@ docker compose logs -f ``` ### 8. Start Caddy +The `(authelia)` snippet in the Caddyfile **must be at the very top**, before any site blocks. +This is required for `import authelia` to work in any site block. + ```bash cd ~/docker/caddy docker compose up -d @@ -137,7 +147,10 @@ In `authelia/docker-compose.yml` the network name must match your existing Caddy Authelia needs to be on the same network as Caddy to be reachable by container name. ### 3. Add the authelia snippet to your existing Caddyfile -Add at the top of your Caddyfile (before any site blocks): +The `(authelia)` snippet **must be at the top of the Caddyfile**, before any site blocks. +Without it at the top, `import authelia` in site blocks will fail. + +Add at the very top: ```caddyfile (authelia) { forward_auth authelia:9091 { @@ -186,6 +199,10 @@ cd ~/docker/authelia && docker compose up -d 2. Add user block with hash 3. Restart Authelia: `docker compose restart authelia` 4. Tell user to use "Forgot Password" to set their own password +1. Edit `~/docker/authelia/config/users.yml` +2. Add user block with hash +3. Restart Authelia: `docker compose restart authelia` +4. Tell user to use "Forgot Password" to set their own password ## Logging in