Redis listens on port 6379. Nextcloud uses Redis for transactional file locking and as a distributed cache – on the same host, preferably via Unix socket (unixsocket /run/redis/redis.sock) instead of TCP.
Never on the internet. Out of the box Redis has no password; open instances get taken over automatically, e.g. for crypto miners or to write SSH keys. Set bind 127.0.0.1, protected-mode yes and requirepass or ACLs.
Typical: Nextcloud reports Redis server went away or file locks hang because the web server user has no access to the socket (group redis).
Check
redis-cli -h 127.0.0.1 -p 6379 ping