Hallo zusammen!
Mein Ziel ist es, Nextcloud im Container (Docker oder gerne Podman) auf RaspberryPi 4 mit Postgres (Datenbank) und Redis (für PHP) einzurichten. Details zu meinem System ganz unten.
Hier im Forum habe ich einen ziemlich passenden Thread gefunden, der aber noch keine Antwort erhalten hatte:
Raspberry Pi 4 (4 GB) neu aufsetzen: Pi-hole + Nextcloud – bestes Setup für langfristige Updates?
ich plane, meinen Raspberry Pi 4 mit 4 GB RAM komplett neu aufzusetzen und hätte dazu gern Euren Rat.
Aktuell läuft auf dem Raspi Raspbian GNU/Linux 10 (Buster) mit Pi-hole . Da Buster inzwischen EOL ist, möchte ich das System sauber neu installieren und zukunftssicher aufstellen.
Geplant ist folgendes Setup:
- Raspberry Pi 4 Computer Modell B, 4GB RAM, SanDisk Extreme micro SDHC A1 UHS-I U3 Speicherkarte + Adapter 32GB
- aktuelles Betriebssystem (Bullseye oder Bookworm?)
- Pi-hole
Hier wird eine ähnliche Konfiguration erwähnt (Pihole nativ, Nextcloud im Docker), aber nicht der Weg dorthin erläutert (nur um zu zeigen, dass ich vorher gesucht habe):
RE: Komplett oversized Werbeblocker
Bisher habe ich versucht, dies mithilfe der AI (ChatGPT oder Le Chat von Mistral) zu basteln, bin aber stets gescheitert. Zusammengefasst: Bei Podman (egal ob rootless oder rootfull) hatte ich Probleme, weil Redis die redis-session.ini nicht schreiben konnte, bei Docker konnte die Datenbank das Netzwerk nicht finden.
Nun möchte ich die natürlichen Intelligenzen fragen, die sich hier aufhalten: Kann mir jemand den entscheidenden Fehler (und idealerweise auch Lösungsweg) aufzeigen, wie ich das System zum Laufen bringe? Oder wo ich einen Denkfehler habe und das so nichts werden kann?
Hier die Details:
podman-compose.yml
version: "3.8"
volumes:
nextcloud_db_data:
nextcloud_apps:
nextcloud_config:
nextcloud_custom_apps:
services:
nextcloud-db:
image: postgres:18
container_name: nextcloud-db
environment:
POSTGRES_DB_FILE: /srv/nextcloud/secrets/postgres_db
POSTGRES_USER_FILE: /srv/nextcloud/secrets/postgres_user
POSTGRES_PASSWORD_FILE: /srv/nextcloud/secrets/postgres_password
secrets:
- postgres_db
- postgres_password
- postgres_user
volumes:
- nextcloud_db_data:/var/lib/postgresql/data
networks:
- nextcloud_network
restart: unless-stopped
nextcloud-redis:
image: redis:alpine
container_name: nextcloud-redis
networks:
- nextcloud_network
restart: unless-stopped
nextcloud-app:
image: nextcloud:33.0.0
container_name: nextcloud-app
user: "0:0" # Als root starten (UID 0)
depends_on:
- nextcloud-db
- nextcloud-redis
ports:
- "8080:80"
environment:
POSTGRES_HOST: nextcloud-db
POSTGRES_DB_FILE: /srv/nextcloud/secrets/postgres_db
POSTGRES_USER_FILE: /srv/nextcloud/secrets/postgres_user
POSTGRES_PASSWORD_FILE: /srv/nextcloud/secrets/postgres_password
NEXTCLOUD_ADMIN_USER_FILE: /srv/nextcloud/secrets/nextcloud_admin_user
NEXTCLOUD_ADMIN_PASSWORD_FILE: /srv/nextcloud/secrets/nextcloud_admin_password
REDIS_HOST: nextcloud-redis
NEXTCLOUD_TRUSTED_DOMAINS: meine-Dyn-DNS-Adresse
PHP_MEMORY_LIMIT: 512M
PHP_UPLOAD_LIMIT: 512M
# PODMAN_DNS_SERVERS: 192.168.175.30 # mein Pi-Hole als DNS-Server, hilft aber auch nicht.
secrets:
- postgres_db
- postgres_password
- postgres_user
- nextcloud_admin_user
- nextcloud_admin_password
volumes:
- nextcloud_apps:/var/www/html/apps
- nextcloud_config:/var/www/html/config
- nextcloud_custom_apps:/var/www/html/custom_apps
- /mnt/nextcloud-data:/var/www/html/data
networks:
- nextcloud_network
restart: unless-stopped
secrets:
nextcloud_admin_password:
file: ./secrets/nextcloud_admin_password.txt
nextcloud_admin_user:
file: ./secrets/nextcloud_admin_user.txt
postgres_db:
file: ./secrets/postgres_db.txt
postgres_password:
file: ./secrets/postgres_password.txt
postgres_user:
file: ./secrets/postgres_user.txt
networks:
nextcloud_network:
driver: bridge
ipam:
config:
- subnet: 10.10.10.0/24
gateway: 10.10.10.1
Display More
Fehlermeldung (relevanter Auszug):
pi@raspberrypi:/srv/nextcloud $ podman logs --since 5m nextcloud_nextcloud-app_1
Configuring Redis as session handler
/entrypoint.sh: 118: cannot create /usr/local/etc/php/conf.d/redis-session.ini: Permission denied
Configuring Redis as session handler
/entrypoint.sh: 118: cannot create /usr/local/etc/php/conf.d/redis-session.ini: Permission denied
Und bei Docker:
docker-compose.yml
version: "3.8"
volumes:
nextcloud_db_data:
nextcloud_apps:
nextcloud_config:
nextcloud_custom_apps:
services:
nextcloud-db:
image: postgres:18
container_name: nextcloud-db
environment:
POSTGRES_DB_FILE: /run/secrets/postgres_db
POSTGRES_USER_FILE: /run/secrets/postgres_user
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
secrets:
- postgres_db
- postgres_password
- postgres_user
volumes:
- nextcloud_db_data:/var/lib/postgresql/data
networks:
- nextcloud_network
restart: unless-stopped
nextcloud-redis:
image: redis:alpine
container_name: nextcloud-redis
networks:
- nextcloud_network
restart: unless-stopped
nextcloud-app:
image: nextcloud:33.0.0
container_name: nextcloud-app
depends_on:
- nextcloud-db
- nextcloud-redis
ports:
- "8080:80"
environment:
POSTGRES_HOST: nextcloud-db
POSTGRES_DB_FILE: /run/secrets/postgres_db
POSTGRES_USER_FILE: /run/secrets/postgres_user
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
NEXTCLOUD_ADMIN_USER_FILE: /run/secrets/nextcloud_admin_user
NEXTCLOUD_ADMIN_PASSWORD_FILE: /run/secrets/nextcloud_admin_password
REDIS_HOST: nextcloud-redis
NEXTCLOUD_TRUSTED_DOMAINS: meine-Dyn-DNS-Adresse
PHP_MEMORY_LIMIT: 512M
PHP_UPLOAD_LIMIT: 512M
secrets:
- postgres_db
- postgres_password
- postgres_user
- nextcloud_admin_user
- nextcloud_admin_password
volumes:
- nextcloud_apps:/var/www/html/apps
- nextcloud_config:/var/www/html/config
- nextcloud_custom_apps:/var/www/html/custom_apps
- /mnt/nextcloud-data:/var/www/html/data
networks:
- nextcloud_network
restart: unless-stopped
secrets:
nextcloud_admin_password:
file: ./secrets/nextcloud_admin_password.txt
nextcloud_admin_user:
file: ./secrets/nextcloud_admin_user.txt
postgres_db:
file: ./secrets/postgres_db.txt
postgres_password:
file: ./secrets/postgres_password.txt
postgres_user:
file: ./secrets/postgres_user.txt
networks:
nextcloud_network:
external: true
Display More
Fehlermeldung (relevanter Auszug):
pi@raspberrypi:/srv/nextcloud $ docker compose up -d
WARN[0000] /srv/nextcloud/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] up 7/7
✔ Volume nextcloud_nextcloud_custom_apps Created 0.0s
✔ Volume nextcloud_nextcloud_db_data Created 0.0s
✔ Volume nextcloud_nextcloud_apps Created 0.0s
✔ Volume nextcloud_nextcloud_config Created 0.0s
✔ Container nextcloud-db Started 1.2s
✔ Container nextcloud-redis Started 1.2s
✔ Container nextcloud-app Started 1.7s
pi@raspberrypi:/srv/nextcloud $ docker inspect nextcloud-db | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "",
pi@raspberrypi:/srv/nextcloud $ docker network inspect nextcloud_network
[
{
"Name": "nextcloud_network",
"Id": "57ef739b2c87c01814c179e641e589b94437a6f361e035fdb95feebe57e73132",
"Created": "2026-04-06T02:33:08.717778999+02:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "10.10.10.0/24",
"Gateway": "10.10.10.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"74e4217ac035c3d0eadf528c87e4b92e8abd244e74d51dea6638c10b88584128": {
"Name": "nextcloud-redis",
"EndpointID": "793154b6561f63f0953717bcf3bb510e88b7603fcfb279a6ed4e95d3815252fc",
"MacAddress": "02:42:0a:0a:0a:03",
"IPv4Address": "10.10.10.3/24",
"IPv6Address": ""
},
"ed4d14d8b5d46216c3cedec7adf505ebee3e5dde24f10157e850828fba98a655": {
"Name": "nextcloud-app",
"EndpointID": "85c947bce1f8cf74a637e9454fb7db663efc3fa654fb802e1b76397b6a002d1c",
"MacAddress": "02:42:0a:0a:0a:04",
"IPv4Address": "10.10.10.4/24",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
Display More
Die Fehlermeldung in den Logs ist zu lang, als dass ich sie komplett kopieren könnte. Hier der Teil, der sich dauernd wiederholt:
#10 /var/www/html/3rdparty/symfony/console/Command/Command.php(326): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/3rdparty/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/lib/private/Console/Application.php(187): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/console.php(92): OC\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#16 /var/www/html/occ(33): require_once('/var/www/html/c...')
#17 {main}
Retrying install...
Error while trying to create admin account: An exception occurred in the driver: SQLSTATE[08006] [7] could not translate host name "nextcloud-db" to address: Name or service not known
Trace: #0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1976): Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(Object(Doctrine\DBAL\Driver\PDO\Exception), NULL)
#1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1924): Doctrine\DBAL\Connection->handleDriverException(Object(Doctrine\DBAL\Driver\PDO\Exception), NULL)
#2 /var/www/html/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php(257): Doctrine\DBAL\Connection->convertException(Object(Doctrine\DBAL\Driver\PDO\Exception))
#3 /var/www/html/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php(192): Doctrine\DBAL\Connections\PrimaryReadReplicaConnection->connectTo('primary')
#4 /var/www/html/lib/private/DB/Connection.php(248): Doctrine\DBAL\Connections\PrimaryReadReplicaConnection->performConnect('primary')
#5 /var/www/html/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php(224): OC\DB\Connection->performConnect('primary')
#6 /var/www/html/lib/private/Setup/AbstractDatabase.php(125): Doctrine\DBAL\Connections\PrimaryReadReplicaConnection->ensureConnectedToPrimary()
#7 /var/www/html/lib/private/Setup/PostgreSQL.php(92): OC\Setup\AbstractDatabase->connect()
#8 /var/www/html/lib/private/Setup.php(384): OC\Setup\PostgreSQL->setupDatabase()
#9 /var/www/html/core/Command/Maintenance/Install.php(77): OC\Setup->install(Array, NULL)
#10 /var/www/html/3rdparty/symfony/console/Command/Command.php(326): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/3rdparty/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/lib/private/Console/Application.php(187): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/console.php(92): OC\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#16 /var/www/html/occ(33): require_once('/var/www/html/c...')
#17 {main}
Display More
Mein System:
OS: Debian GNU/Linux 13 (trixie) aarch64 (RaspianOS)
Host: Raspberry Pi 4 Model B Rev 1.1
Kernel: Linux 6.12.75+rpt-rpi-v8
Revision : c03111
sda1: Externe USB-Festplatte, gemountet auf /mnt/nextcloud
sdb1: Externe USB-Festplatte, gemountet auf /media/pi/rpi-Backup-HDD
mmcblk0 179:0 0 238,3G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 237,8G 0 part /
weitere Software/Dienste
Pihole, belegt Port 53, dient als DNS-Server
Welche Details fehlen noch?
Herzlichen Dank und beste Grüße
t_matze