Update README for Docker network and Caddyfile instructions

Clarify instructions for Docker network and Caddyfile snippet placement.
This commit is contained in:
Outis
2026-06-01 09:46:14 -04:00
committed by GitHub
parent d4e61bafc4
commit e38df023ad
+20 -3
View File
@@ -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. 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 ```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 ### 7. Start Authelia
```bash ```bash
cd ~/docker/authelia cd ~/docker/authelia
@@ -87,6 +94,9 @@ docker compose logs -f
``` ```
### 8. Start Caddy ### 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 ```bash
cd ~/docker/caddy cd ~/docker/caddy
docker compose up -d 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. 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 ### 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 ```caddyfile
(authelia) { (authelia) {
forward_auth authelia:9091 { forward_auth authelia:9091 {
@@ -186,6 +199,10 @@ cd ~/docker/authelia && docker compose up -d
2. Add user block with hash 2. Add user block with hash
3. Restart Authelia: `docker compose restart authelia` 3. Restart Authelia: `docker compose restart authelia`
4. Tell user to use "Forgot Password" to set their own password 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 ## Logging in