HUB
Sign inSign up
nextcloud logo

dgcosenza/nextcloud

By dgcosenza

•Updated about 12 hours ago

Nextcloud on Debian 13 with source-built NGINX 1.30 (HTTP/3 + Brotli), PHP 8.4, 0 fixable CVEs.

Image
0

2.4K

dgcosenza/nextcloud repository overview

⁠Nextcloud — Debian 13 (trixie-slim) / NGINX 1.30 / PHP 8.4 FPM Image

Daily CI OpenSSF Scorecard Workflow Gitleaks Secret Scan Public Content Check OpenSSF Scorecard OpenSSF Best Practices

Trivy + Grype: 0 Fixable CVEs Signed: Cosign OIDC SLSA Build L3 SBOM: SPDX + CycloneDX Base OS Architectures Healthcheck: CI Verified Renovate Enabled Dependabot Enabled Daily Rebuilds

Latest Release Release Date Last Commit Docker Pulls Docker Image Size Registries: Docker Hub + GHCR Packaging License: MIT Upstream License GitHub Issues FNX Labs Catalog

A hardened, drop-in Nextcloud container image on Debian 13 (trixie-slim) combining the SHA-256-verified official Nextcloud server release, source-built NGINX 1.30 (HTTP/3 QUIC + dynamically linked ngx_brotli), and PHP 8.4 FPM, maintained by Daniel G. Cosenza from FNX Labs.


⁠Overview

dgcosenza/nextcloud packages the latest official Nextcloud release on fully upgraded Debian 13 (trixie-slim):

  • Drop-in /config and /data compatibility: Preserves PUID/PGID (user abc), /app/www/public symlinked to /config/www/nextcloud/{apps,config,themes}, /config/nginx/ (supporting HTTP/3 quic and brotli), /config/keys/cert.{crt,key}, /config/php/{php-local.ini,www2.conf}, /data, and the occ CLI helper (/usr/local/bin/occ).
  • Full PHP 8.4 & media stack: Ships PHP 8.4 FPM with apcu, bcmath, bz2, curl, gd, gmp, igbinary, imagick, intl, ldap, mbstring, memcached, msgpack, mysql, pgsql, redis, smbclient, soap, sqlite3, xml, xsl, zip, plus ffmpeg, imagemagick, and smbclient.
  • Downgrade protection & background cron: Refuses to start if mounted data is newer than the image release, runs occ upgrade automatically on core upgrades, and executes cron.php every 5 minutes as non-root abc without needing setuid crond (100% compatible with security_opt: no-new-privileges:true).
  • notify_push sidecar compatible: Works seamlessly with Nextcloud notify_push sidecar containers overriding the entrypoint against the shared /config volume.

⁠Current Versions

ComponentResolved Version
Nextcloud35.0.3
NGINX1.30.8
PHP-FPM8.4.28
Base OSDebian 13.8 (trixie-slim)
Architectureslinux/amd64, linux/arm64
Uncompressed size (per arch)amd64: 534.7 MB, arm64: 1494.2 MB
Last verified build (UTC)2026-11-28
Published multi-arch digestdgcosenza/nextcloud@sha256:96da65456bbeaf99e1d2d66a64d0764d26881bf4b9df1b6f684d5dc0a2c7dd44
GHCR mirrorghcr.io/dgcosenza/nextcloud@sha256:96da65456bbeaf99e1d2d66a64d0764d26881bf4b9df1b6f684d5dc0a2c7dd44
Supply chainCosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance
Security gate (Trivy + Grype on SBOM)0 fixable findings of any severity (74 upstream-unfixed)

⁠Supported Tags

TagPolicyDescription
<version>-<YYYYMMDD> (e.g. 35.0.3-20261124)ImmutableDate-stamped daily rebuild pinning the Nextcloud release and UTC build date.
sha-<short>ImmutablePackaging repository Git commit tag.
<version> (e.g. 35.0.3)MovingLatest verified Debian 13 security rebuild of that Nextcloud release.
latestMovingLatest verified build tracking the newest official Nextcloud release.

Production pinning: Pin by registry digest (and review major Nextcloud upgrades before bumping):

image: dgcosenza/nextcloud:35.0.3@sha256:<digest>

⁠Supported Architectures

ArchitectureStatusVerification
linux/amd64Published & natively testedBuilt, smoke-tested, Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native x86_64 CI runners.
linux/arm64Published & natively testedBuilt, smoke-tested, Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native ARM64 CI runners.

⁠Identical multi-arch OCI manifest digests are published to Docker Hub and GHCR (ghcr.io/dgcosenza/*), accompanied by automated signed GitHub Releases⁠.

⁠Quick Start

See docker-compose.example.yml⁠:

docker run -d \
  --name nextcloud \
  --restart unless-stopped \
  --security-opt no-new-privileges:true \
  -p 192.0.2.10:8084:443 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -v "$(pwd)/config:/config" \
  -v "$(pwd)/data:/data" \
  dgcosenza/nextcloud:latest

⁠Configuration

⁠Environment Variables
VariableRequiredDefaultDescription
PUIDNo1000UID assigned to the abc NGINX/PHP-FPM/cron user.
PGIDNo1000GID assigned to the abc group.
TZNoEtc/UTCContainer timezone (IANA timezone name).
NEXTCLOUD_CRON_INTERVALNo300Seconds between php -f /app/www/public/cron.php runs (0 disables the internal loop).
⁠Volumes, Ports, and UID/GID
Path / PortMode / OwnerPurpose
/configPUID:PGID (abc)Persistent Nextcloud www/nextcloud/{config,apps,themes}, nginx/, keys/, php/, and log/.
/dataPUID:PGID (abc)Persistent Nextcloud user file storage.
80/tcp, 443/tcpContainer portsHTTP and HTTPS/HTTP3 listeners.

Run administrative commands via docker exec nextcloud occ status.


⁠Healthcheck

HEALTHCHECK --interval=30s --timeout=10s --start-period=180s --retries=3 \
    CMD ["sh", "-c", "curl -fsSk https://127.0.0.1:443/status.php >/dev/null || exit 1"]

Probes Nextcloud's /status.php endpoint over local HTTPS.


⁠Upgrading and Migrating from lscr.io/linuxserver/nextcloud

  1. Always back up first: Dump the Nextcloud database (mariadb-dump / mysqldump) and archive ./config (and snapshot ./data).
  2. Tag your outgoing image for rollback.
  3. Verify the target image's Nextcloud version is equal to or one major/minor step ahead of your installed config.php version (never downgrade or skip multiple major releases).
  4. Pin image: dgcosenza/nextcloud:<version>@sha256:<digest> on nextcloud (and any notify_push sidecar sharing the image), recreate with docker compose up -d --no-deps nextcloud notify_push, and verify occ status, /status.php, and notify_push health.

⁠Supply-Chain Verification

Every published digest (multi-arch index and per-architecture manifests) on both Docker Hub and GHCR is keyless-signed with Sigstore Cosign (GitHub OIDC), attested with SPDX and CycloneDX SBOMs, and backed by SLSA Build L3 provenance (actions/attest-build-provenance).

⁠Verify image signature with Cosign
cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/nextcloud-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/nextcloud:latest

# Or against Docker Hub (identical digest):
cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/nextcloud-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  dgcosenza/nextcloud:latest
⁠Verify SPDX / CycloneDX SBOM attestations and SLSA Build Provenance
cosign verify-attestation \
  --type spdxjson \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/nextcloud-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/nextcloud@sha256:<arch-digest>

gh attestation verify oci://ghcr.io/dgcosenza/nextcloud:latest --owner dgcosenza

⁠Security

  • Vulnerability scan policy (all severities with a fix): Every CI build runs Trivy (table, JSON, SARIF upload, blocking --ignore-unfixed gate) and Grype (--only-fixed, severity cutoff negligible, blocking gate), plus emits an SPDX SBOM (sbom.spdx.json) and provenance artifact.
  • Current status: 0 fixable vulnerabilities of any severity across Debian 13 OS packages, PHP 8.4, NGINX 1.30, and Nextcloud.
  • Bundled PHP dependencies: The official Nextcloud release ships a 3rdparty Composer bundle. At build time the vulnerable bundled packages are patched to their published fixed versions: symfony/filesystem and symfony/http-foundation to v7.4.23, symfony/routing to v6.4.50, and web-auth/webauthn-lib to a patched build carrying the upstream 5.3.5 fix for GHSA-gq4g-fpc9-vjfq. The webauthn patch preserves the 4.x API that Nextcloud 35 uses (upstream 5.x removed classes that Nextcloud calls), and is applied with a checksum-pinned Composer build so the all-severity gates stay green without changing the application's behaviour.
  • Hardening: tini PID 1, no-new-privileges:true compatible via setpriv, workers and background cron run as non-root abc, compilers excluded from runtime layer, built-in Nextcloud self-updater removed.
  • See SECURITY.md⁠.

⁠Build Locally

git clone https://github.com/dgcosenza/nextcloud-docker.git
cd nextcloud-docker

docker buildx build \
  --platform linux/amd64 \
  --load \
  --build-arg BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  --build-arg IMAGE_REVISION="$(git rev-parse HEAD)" \
  -t dgcosenza/nextcloud:local \
  .
Build ArgDefaultPurpose
NEXTCLOUD_VERSION35.0.3Official Nextcloud release version (SHA-256 verified, overridden daily by CI).
NGINX_VERSION1.30.8Official stable NGINX release from nginx.org (overridden daily by CI).
NGX_BROTLI_COMMIT53e0fb55f250f48fe80c0ddbf6c0f7103cdbaae1Pinned google/ngx_brotli commit SHA.
DEBIAN_BASEdebian:trixie-slimBase OS image.

⁠Update Policy

.github/workflows/daily.yml⁠ runs automatically every day at 04:53 UTC, on pushes to main, on pull requests (verification only), and via workflow_dispatch. Every scheduled run executes a seven-step automated pipeline (gated by .github/workflows/public-check.yml):

  1. Upstream check: Queries nextcloud/server latest stable release via the authenticated GitHub API, resolves latest stable NGINX from nginx.org and the debian:trixie-slim base digest, diffs against versions.json, and emits upstream-changes.md.
  2. No-cache rebuild: Rebuilds linux/amd64 with --no-cache on schedule, verifies the Nextcloud tarball SHA-256, compiles NGINX + ngx_brotli, upgrades Debian 13 + PHP 8.4 packages, and emits an SPDX SBOM (sbom.spdx.json) and provenance artifact.
  3. Vulnerability fix and gate: Runs Trivy (table, JSON, SARIF upload, blocking --ignore-unfixed gate) and Grype (blocking --only-fixed gate, severity cutoff negligible), diffs findings against the previous scan, and retains reports for 90 days.
  4. Smoke test: Runs tests/smoke.sh⁠ to verify fresh Nextcloud hydration, tini PID 1, non-root abc NGINX & PHP 8.4 FPM workers, HTTPS /status.php, occ status, and a negative closed-port healthcheck test.
  5. Publish: On non-PR builds when Docker Hub secrets are configured, pushes latest, <version>, <version>-<YYYYMMDD>, and sha-<short> tags to Docker Hub and records the immutable digest.
  6. Automated documentation sync: Commits updated versions.json, the README Current Versions block, and a dated CHANGELOG.md entry via github-actions[bot] with [skip ci] when content changes, then syncs the Docker Hub overview via peter-evans/dockerhub-description.
  7. Failure alerting: On failure, CI opens or updates a single GitHub issue labeled ci-failure with the failing job and run link, and auto-closes it on the next green run.

⁠Design Decisions

  • Debian 13 (trixie-slim) + PHP 8.4 + source-built NGINX 1.30: Nextcloud 35 officially supports PHP 8.3–8.5; Debian 13's PHP 8.4 receives daily Debian Security patches, while source-built NGINX 1.30 provides HTTP/3 QUIC and dynamically linked ngx_brotli.
  • In-process cron loop via setpriv: Runs cron.php every 5 minutes as UID/GID PUID:PGID without requiring root crond or disabling no-new-privileges:true.

⁠License

This repository follows a clear packaging-vs-upstream license split:

  • Container packaging, scripts, CI workflows, and documentation (packaging: MIT): Licensed under the MIT License⁠ — copyright Daniel G. Cosenza from FNX Labs.
  • Bundled upstream software — Nextcloud Server (nextcloud/server) (upstream: AGPL-3.0-or-later): Nextcloud Server is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)⁠. Bundled NGINX and ngx_brotli are BSD-2-Clause; PHP 8.4 is PHP-3.01.

Full third-party notices are maintained in THIRD-PARTY-NOTICES.md⁠. Release history is maintained in CHANGELOG.md⁠.

Tag summary

Content type

Image

Digest

sha256:96da65456…

Size

509.9 MB

Last updated

about 12 hours ago

docker pull dgcosenza/nextcloud