mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-05 00:39:38 +03:00
🐛 Bug Report: "config error: ENCRYPTION_KEY must be at least 16 bytes long" - Docker Compose container restarts #635
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Zydepoint on GitHub (Jan 29, 2026).
hello, i seem to get issues whenever i try to run pocket-id via docker container. i didn't find this issue so i am suspecting the issue might be on my side..
Reproduction steps
what my current docker compose config is:
what i've tried:
right now, the key is in a specified file and i define the path to the file in the .env file:
Expected behavior
I expected either -base64 32 or -hex 32 methods to work, at least after destroying the docker container and rebuilding it from the latest image.
Actual Behavior
the pocked-id docker container restarts endlessly.
Pocket ID Version
v2.0.0 or latest. I run latest right now but i've tried to pinpoint to v2.0.0 and the issue persists
Database
SQLite i'd assume since i don't run a postgres container beside pocket id.
OS and Environment
Docker running on an Ubuntu VM, see versions below:
sudo docker compose versionDocker Compose version v5.0.0
sudo docker versionClient: Docker Engine - Community
Version: 29.1.3
API version: 1.52
Go version: go1.25.5
Git commit: f52814d
Built: Fri Dec 12 15:05:45 2025
OS/Arch: linux/amd64
Context: default
lsb_release -aDistributor ID: Ubuntu
Description: Ubuntu 25.04
Release: 25.04
Codename: plucky
Log Output
@l-maciej commented on GitHub (Jan 30, 2026):
You have to regenerate the key with fitting value in .env file
@Zydepoint commented on GitHub (Feb 2, 2026):
i have done that? the guide says "openssl rand -base64 32" but i've tried that and other methods, and none of them works apparently
@Zydepoint commented on GitHub (Feb 2, 2026):
I see now that the installation guide mentions: "The ENCRYPTION_KEY environment variable is now mandatory. You must set this variable to a at least 16 characters long random string. You can generate a secure random string using openssl rand -base64 32."
but the error suggests the issue is in the size of the encryption key? i tried now using different lengths but none works, tried 16, 32, 64, and a very long one.
@l-maciej commented on GitHub (Feb 2, 2026):
@Zydepoint Checked .env on my other machine
I've just used some key bbut it is not encrypted. Application started without any issues.
Latest version and env from documentation