Homelab Infrastructure β Nextcloud
π£ Host VM: Nextcloud (VMID 105, 192.168.5.141)
π£ Internal URL: http://192.168.5.141:2342
π£ Last Updated: April 2026
| π£ Property | π£ Value |
|---|---|
| App | PhotoPrism |
| Docker Image | photoprism/photoprism:latest |
| Container Name | photoprism |
| Database Container | photoprism-db (MariaDB 11) |
| Host Port | 2342 |
| Compose File | /opt/photoprism/docker-compose.yml |
| Restart Policy | unless-stopped |
| Login | admin / (your password) |
| π£ Purpose | π£ Path |
|---|---|
| Originals (inside container) | /photoprism/originals |
| Originals (host β Nextcloud images) | /var/www/nextcloud/data/kalyssa/files/Image Files |
| Storage / thumbnails / sidecar | /opt/photoprism/storage |
| Database files | /opt/photoprism/database |
| Backups | /photoprism/storage/backups |
| Import path | /photoprism/import |
| π£ Type | π£ Count (at setup) |
|---|---|
| PNG | ~6,048 |
| JPG | ~2,480 |
| SVG | ~1,860 |
| Total | ~10,388 files |
π£ Images are sourced from Nextcloud β the originals folder is mounted read-write from /var/www/nextcloud/data/kalyssa/files/Image Files.
Full compose file at /opt/photoprism/docker-compose.yml:
version: '3.8'
services:
photoprism:
image: photoprism/photoprism:latest
container_name: photoprism
restart: unless-stopped
security_opt:
- seccomp:unconfined
- apparmor:unconfined
ports:
- "2342:2342"
environment:
PHOTOPRISM_ADMIN_USER: "admin"
PHOTOPRISM_ADMIN_PASSWORD: "your_password"
PHOTOPRISM_AUTH_MODE: "password"
PHOTOPRISM_SITE_URL: "http://localhost:2342/"
PHOTOPRISM_ORIGINALS_LIMIT: 10000
PHOTOPRISM_HTTP_COMPRESSION: "gzip"
PHOTOPRISM_LOG_LEVEL: "info"
PHOTOPRISM_READONLY: "false"
PHOTOPRISM_DISABLE_TENSORFLOW: "false"
PHOTOPRISM_DISABLE_FACES: "false"
PHOTOPRISM_DISABLE_CLASSIFICATION: "false"
PHOTOPRISM_DETECT_NSFW: "false"
PHOTOPRISM_UPLOAD_NSFW: "true"
PHOTOPRISM_DATABASE_DRIVER: "mysql"
PHOTOPRISM_DATABASE_SERVER: "mariadb:3306"
PHOTOPRISM_DATABASE_NAME: "photoprism"
PHOTOPRISM_DATABASE_USER: "photoprism"
PHOTOPRISM_DATABASE_PASSWORD: "your_db_password"
HOME: "/photoprism"
working_dir: "/photoprism"
volumes:
- "/var/www/nextcloud/data/kalyssa/files/Image Files:/photoprism/originals"
- "/opt/photoprism/storage:/photoprism/storage"
depends_on:
- mariadb
mariadb:
image: mariadb:11
container_name: photoprism-db
restart: unless-stopped
security_opt:
- seccomp:unconfined
- apparmor:unconfined
command: --innodb-buffer-pool-size=512M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120
volumes:
- "/opt/photoprism/database:/var/lib/mysql"
environment:
MARIADB_AUTO_UPGRADE: "1"
MARIADB_INITDB_SKIP_TZINFO: "1"
MARIADB_DATABASE: "photoprism"
MARIADB_USER: "photoprism"
MARIADB_PASSWORD: "your_db_password"
MARIADB_ROOT_PASSWORD: "your_root_password"
cd /opt/photoprism
# Start
sudo docker compose up -d
# Stop
sudo docker compose down
# Restart
sudo docker compose restart
# Check status
sudo docker compose ps
# Watch logs (open a second SSH session β Ctrl+C here stops log tailing only, NOT containers)
sudo docker compose logs -f photoprism
π£ Important: Always use a second SSH terminal to tail logs. If you Ctrl+C in the same session that started the containers, it will stop them.
Navigate to the index page:
http://192.168.5.141:2342/library/index
π£ First-time setup β check Complete Rescan then click Start. This forces a full index of all originals.
π£ Subsequent runs β leave Complete Rescan unchecked; PhotoPrism only processes new/changed files.
Verify how many files PhotoPrism can see before indexing:
sudo docker exec photoprism find /photoprism/originals -type f \( -iname "*.jpg" -o -iname "*.png" -o -iname "*.svg" \) | wc -l
Check what directories are mounted:
sudo docker exec photoprism ls -la /photoprism/originals
Expected folder structure inside container:
/photoprism/originals/
βββ Backgrounds/
βββ Image Files for Projects/
βββ SVG Animals.zip
π£ Some JPG/PNG files detected as text/plain
PhotoPrism skips files where the actual file content doesn't match the extension. These are corrupt or mislabeled files from the source. Not a PhotoPrism bug β those files are genuinely broken.
index: skipped 'Image Files for Projects/teapot.jpg' because it has an invalid extension for media type 'text/plain'
π£ WebP conversion failures
PhotoPrism attempts to convert .webp files to JPG for preview generation and may fail with:
index: could not create preview image for '....webp'
This is a missing ImageMagick support issue inside the container. WebP files are still indexed, just without thumbnail previews.
π£ Only ~91 files indexed on first run
The first indexing run only caught 91 files despite 6,533 being visible. Fixed by running a Complete Rescan from the Library index page. Always use Complete Rescan after a fresh deploy or database wipe.
π£ Database password mismatch on fresh deploy
If you wipe /opt/photoprism/database/ and restart, you must ensure PHOTOPRISM_DATABASE_PASSWORD and MARIADB_PASSWORD in the compose file match exactly. A mismatch produces:
Error 1045 (28000): Access denied for user 'photoprism'@'...'
Fix: wipe the database folder and restart with matching passwords.
sudo docker compose down
sudo rm -rf /opt/photoprism/database/*
sudo docker compose up -d
π£ Permissions on Nextcloud originals
The Image Files directory is owned by www-data. PhotoPrism runs as root (uid 0) inside the container so it can read them, but direct host-side ls on that path requires sudo.
If PhotoPrism needs a full reset:
cd /opt/photoprism
# Stop containers
sudo docker compose down
# Wipe database (keeps your originals safe β they're in Nextcloud)
sudo rm -rf /opt/photoprism/database/*
# Optionally wipe thumbnails/cache too
sudo rm -rf /opt/photoprism/storage/*
# Start fresh
sudo docker compose up -d
# Watch startup
sudo docker compose logs -f photoprism
Then re-index via the web UI at http://192.168.5.141:2342/library/index with Complete Rescan checked.
π£ Your original images are never touched β they live in Nextcloud at /var/www/nextcloud/data/kalyssa/files/Image Files and are mounted read-write. Wiping the PhotoPrism database only removes the index, thumbnails, and metadata β not the source files.
π£ Tags: photoprism β’ photos β’ docker β’ nextcloud β’ media β’ mariadb β’ image-library