Bug Report: .env.example ships ENCRYPTION_KEY empty, so the stock compose crash-loops silently instead of failing once
Reproduction steps
mkdir pocket-id && cd pocket-id
curl -o docker-compose.yml https://raw.githubusercontent.com/pocket-id/pocket-id/main/docker-compose.yml
curl -o .env https://raw.githubusercontent.com/pocket-id/pocket-id/main/.env.example
# edit APP_URL, leave the rest as shipped
docker compose up -d
docker compose ps # → Restarting
docker compose logs # → config error: ENCRYPTION_KEY must be at least 16 bytes long (repeating)Expected behavior
Either the stack starts, or docker compose up fails once, loudly, saying
what to set. Something a reader piping the two files down cannot miss.
Actual Behavior
.env.example ships ENCRYPTION_KEY= (empty). Combined with
restart: unless-stopped, the container crash-loops silently: up -d
returns 0, ps shows Restarting, and the only signal is in the logs. The
comment in the file does say to generate a key — the problem is the failure
mode, not the documentation.
Suggestions (any one; happy to PR whichever you prefer):
- Comment the key line out (
# ENCRYPTION_KEY=) so a missing value is obviously the user's to fill, rather than a present-but-empty one. - Or switch the compose to
environment:withENCRYPTION_KEY=${ENCRYPTION_KEY:?generate one with: openssl rand -base64 32}, so compose refuses to start with that message instead of looping. - Or note the required step in
docker-compose.ymlitself, next toenv_file.
Pocket ID Version: v2.16.0 (pocketid/pocket-id:v2 pulled 2026-09-27; first seen on v2.14.0, 2026-08-28). .env.example unchanged on main since 2026-07-13
Database: SQLite (default)
OS and Environment: Docker on Ubuntu 26.04 LTS (2026-08-28) and on macOS/arm64 (2026-09-27, v2.16.0), no reverse proxy, stock docker-compose.yml + .env.example
Log Output: config error: ENCRYPTION_KEY must be at least 16 bytes long (repeats every restart)
(Found while verifying our published install snippet at selfhostatlas.com —
we now fill the key inline with
sed -i "s|^ENCRYPTION_KEY=$|ENCRYPTION_KEY=$(openssl rand -base64 32)|" .env.
https://selfhostatlas.com/self-host/pocket-id.)
Source: pocket-id/pocket-id