Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .config/redis.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
if (getenv('REDIS_HOST_USER') !== false) {
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
}

if (getenv('REDIS_HOST_DB') !== false) {
$CONFIG['redis']['dbindex'] = (int) getenv('REDIS_HOST_DB');
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ To use Redis for memory caching as well as PHP session storage, specify the foll
- `REDIS_HOST_PORT` (default: `6379`) Optional port for Redis, only use for external Redis servers that run on non-standard ports.
- `REDIS_HOST_USER` (not set by default) Optional username for Redis, only use for external Redis servers that require a user.
- `REDIS_HOST_PASSWORD` (not set by default) Redis password
- `REDIS_HOST_DB` (default: `0`) Index of the Redis database to use, set dbindex parameter in the redis config file for Nextcloud.

@Tireur2cables Tireur2cables Aug 9, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that the session storage part is relevant for any user


Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html) for more information.

Expand Down
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ configure_redis_session() {

case "$REDIS_HOST" in
/*)
redis_save_path="unix://${REDIS_HOST}"
redis_save_path="unix://${REDIS_HOST}/${REDIS_HOST_DB:=0}"
;;
*)
redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}"
redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}/${REDIS_HOST_DB:=0}"
Comment on lines +107 to +110

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is intended I think

;;
Comment on lines +107 to 111

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is fake but I may misunderstand how this path is used. Redis url template uses /dbindex and not ?database=

esac

Expand Down