Disabling LibreChat Authentication Workarounds | Generated by AI
Short answer: you can’t completely turn off authentication in LibreChat, but you can stop the “keep asking me to log in” problem and make it feel close to “no-login.” Here’s what actually works (and why):
1) You can’t disable auth entirely
This is confirmed by the maintainer: registration can be disabled, but the auth system itself can’t be turned off. (GitHub)
2) Why you keep getting logged out
If you access your instance over HTTP (e.g., LAN IP), cookies are marked secure
in production so the browser won’t keep them; you get booted back to login. Use HTTPS (even self-signed) or run the API in a dev mode that disables secure cookies. (GitHub)
3) Two reliable fixes
Option A — Proper/secure (recommended)
- Put LibreChat behind HTTPS (nginx/caddy/traefik; self-signed is fine on LAN).
-
Then bump the session windows in your
.env
:SESSION_EXPIRY=1000 * 60 * 60 * 24 # 24h REFRESH_TOKEN_EXPIRY=(1000 * 60 * 60 * 24) * 30 # 30d
- Restart containers after changing env. This keeps you logged in for days/weeks and fixes the cookie drop. (GitHub)
Option B — “I’m on a private LAN and just want it to stop logging out”
-
Create a
docker-compose.override.yml
and run the API in dev mode (disables secure cookies):services: api: command: npm run backend:dev
-
docker compose up -d
to apply. This is less secure (cookies notsecure
), but it stops the forced re-login over plain HTTP. (librechat.ai)
4) Optional quality-of-life tweaks
-
Disable new signups so it’s effectively single-user:
ALLOW_REGISTRATION=false
(You can still add users via
npm run create-user
if needed.) (librechat.ai) -
Keep other auth toggles in
.env
(email/social login flags) if you want the simplest login path. (librechat.ai)
5) Quick checklist for your case (v0.8.0-rc3)
- Decide: HTTPS proxy (best) or dev mode (quick LAN fix).
- Set longer
SESSION_EXPIRY
andREFRESH_TOKEN_EXPIRY
in.env
. - Restart the stack so env changes take effect.
- (Optional) Turn off registration for a “single-user” feel.
If you want, paste your current docker-compose.yml
and .env
(without secrets). I’ll mark exactly what to add/change for your setup.