Tune PostgreSQL and PHP settings for Nextcloud inside Docker container on RPi 5

Published on Author admin

Tune PostgreSQL and PHP settings for Nextcloud inside Docker container on RPi 5

PostgreSQL settings

change variables inside PG_DATA/postgresql.conf config file

shared_buffers = 256MB
work_mem = 8MB

restart PostgreSQL database:

docker restart nextcloud-postgres

verify:

docker exec -it nextcloud-postgres psql -U nextcloud -d nextcloud -c "SHOW shared_buffers"
docker exec -it nextcloud-postgres psql -U nextcloud -d nextcloud -c "SHOW work_mem;"

PHP settings
in YAML file (docker-compose) for nextcloud-app and nextcloud-cron containers:

environment:
- PHP_MEMORY_LIMIT=1024M

verify:

docker exec -it nextcloud-app php -i | grep memory_limit
docker exec -it nextcloud-cron php -i | grep memory_limit