User Tools

Site Tools


config:authelia-npm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
config:authelia-npm [2026/03/18 21:57] – [Authelia SSO backend] Wuffconfig:authelia-npm [2026/03/19 22:34] (current) – [Redis for Authelia session] Wuff
Line 467: Line 467:
 Make sure to remove the advanced nginx config in NPM and enable websocket support in NPM. Make sure to remove the advanced nginx config in NPM and enable websocket support in NPM.
 The OIDC integration replaces the proxy authelia protection.  The OIDC integration replaces the proxy authelia protection. 
 +
 +===== Redis for Authelia session =====
 +
 +Authelia stores session data in memory by default. This means whenever the container or server is restarted, all users will have to log in again as the session data is lost. To store data across restarts, Redis can be used as in memory database and cache. 
 +
 +Authelia docker compose file should be adjusted as following:
 +<code yaml>
 +name: authelia
 +services:
 +  authelia:
 +    image: authelia/authelia
 +    container_name: authelia
 +    restart: unless-stopped
 +    volumes:
 +      - /opt/authelia:/config
 +    ports:
 +      - 6091:9091
 +    environment:
 +      - TZ=Europe/London
 +    depends_on:
 +      redis:
 +        condition: service_started
 +  redis:
 +    image: redis:alpine
 +    container_name: authelia-redis
 +    command: >
 +      redis-server
 +      --appendonly yes
 +      --appendfsync everysec
 +      --save 900 1
 +      --save 300 10
 +      --save 60 10000
 +    volumes:
 +      - /opt/authelia/redis:/data
 +    restart: unless-stopped
 +</code>
 +
 +And in /opt/authelia/configuration.yml add redis to the session section:
 +<code>
 +session:
 +  redis:
 +    host: authelia-redis
 +    port: 6379
 +</code>
 +
 +Then stop and fully restart the authelia container.
config/authelia-npm.1773871079.txt.gz · Last modified: by Wuff