Redis

From The Brainwrecked Wiki
Jump to navigation Jump to search

Redis (REmote DIctionary Server) is an in-memory key-value database for abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indexes.

Prerequisites

None

Utilized By

Gitea (optional)
Nextcloud (optional)
OnlyOffice Document Server (binary version)
PHP-Redis
Allows PHP applications to use Redis
Rspamd (optional)
WordPress (optional, requires plugin)

Required Packages

sudo pacman -Syu redis

Optional Packages

This will give PHP applications (like Nextcloud and WordPress) access to the Redis server.

sudo pacman -Syu php-redis

Configuration

By default, redis is already configured to bind to 127.0.0.1:6379, but the Unix socket is not enabled.

/etc/redis.conf
...
# Unix socket.
#
# Specify the path for the Unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
unixsocket /run/redis/redis.sock
unixsocketperm 700
...

You will also need to add users to the redis group so processes can access redis

for username in gitea http rspamd; do sudo usermod -G redis ${username}; done