Minimal, production-minded Docker images for PocketBaseâ , shipped in two flavors:
root, for environments where that's simpler or required.Use a multi-stage Alpine build that downloads a pinned PocketBase release, verifies its SHA-256 checksum against the published checksums.txt, and ships only the binary in the runtime image. An entrypoint script optionally bootstraps the superuser and enables settings encryption on every start.
pocketbase binary in the final layer).amd64 / arm64) via buildx TARGETARCH.HEALTHCHECK hitting /api/health.pb_data volume for the SQLite database and uploads.| Variable | Default | Description |
|---|---|---|
PB_VERSION | 0.39.9 | PocketBase release to build (published tag without the leading v). |
CONTAINER_NAME | pocketbase | Base name for the container. |
PB_PORT | 8070 | Port for the stack (used inside the container and for the host mapping). |
PB_ADMIN_EMAIL | (empty) | Superuser email to bootstrap. Leave blank to skip bootstrapping. |
PB_ADMIN_PASSWORD | (empty) | Superuser password. Required only when the admin doesn't yet exist. |
PB_ENCRYPTION_KEY | (empty) | Settings-encryption key. Must be exactly 32 characters. Leave blank to disable. |
On every start the entrypoint checks whether PB_ADMIN_EMAIL already exists in the database:
PB_ADMIN_PASSWORD is ignored).PB_ADMIN_PASSWORD (required in that case, otherwise the container exits with an error).PB_ADMIN_EMAIL blank â bootstrap is skipped entirely.To encrypt application settings stored in the database, set a 32-character PB_ENCRYPTION_KEY. Generate one with:
openssl rand -hex 16
The entrypoint validates the length and passes --encryptionEnv=PB_ENCRYPTION_KEY to PocketBase. See the PocketBase production docsâ .
The SQLite database and uploaded files live in /pb/pb_data, backed by the named Docker volume pb_data. Data survives container recreation. To develop migrations/hooks against the running instance, uncomment the bind mounts in the Compose file:
# - ./pb_migrations:/pb/pb_migrations
# - ./pb_hooks:/pb/pb_hooks
You can also bake pb_migrations / pb_hooks into the image by uncommenting the corresponding COPY lines in the Dockerfile.
Both images define a HEALTHCHECK that polls http://127.0.0.1:${PB_PORT}/api/health. Check status with:
docker ps
docker inspect --format '{{.State.Health.Status}}' pocketbase
PocketBase is distributed under its own licenseâ . This repository contains only the Docker packaging.
Content type
Image
Digest
sha256:984bb82b5âĶ
Size
17.3 MB
Last updated
9 days ago
docker pull tajniak81/pocketbase-docker-root