There was a problem loading the comments.

Redis installation

Support Portal  »  Knowledgebase (FAQ)  »  Viewing Article

  Print
Editions: All
Versions: 6.5.0+

 

VIMP also requires a Redis database for certain functions.

 

Below, we provide step-by-step instructions for installation and setup on Debian/Ubuntu and RedHat/AlmaLinux-based distributions.

 

Debian 13/Ubuntu 24.04

First, we check which version of Redis is available in the repository:

 

apt-cache madison redis-server

 

If you see an output such as

 

redis-server | 5:6.0.16-1ubuntu1.1 | http://de.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
redis-server | 5:6.0.16-1ubuntu1.1 | http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
redis-server | 5:6.0.16-1ubuntu1 | http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

 

then Redis is version 6.0.x, and we need to install Redis from the official Redis repository (next section). If, on the other hand, the version is at least 6.2, then Redis can be installed from the distribution repository (section after the next).

 

Install Redis from the Redis repository

sudo apt update
sudo apt install -y lsb-release curl gpg

curl -fsSL https://packages.redis.io/gpg \
  | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" \
  | sudo tee /etc/apt/sources.list.d/redis.list

sudo apt update

 

Next, we'll check the Redis versions that are now available:

 

apt-cache madison redis-server

 

And install a specific version greater than 6.2, for example:

 

sudo apt install \
  redis-server=6:7.4.11-1rl1~jammy1 \
  redis-tools=6:7.4.11-1rl1~jammy1

 

and check the version:

 

redis-cli -v

 

All done - Redis is installed.

 

Install Redis from the distribution repository

If the first version check - without the Redis repository - already shows a version of 6.2.x or higher, then we install Redis using only the following command:

 

apt install redis-server redis-tools

 

Please check the version of Redis that is installed:

 

redis-cli -v

 

Done!

 

Install the Redis PHP extension 

Finally, you need to install the PHP extension for Redis:

 

apt install php8.3-redis

 

If you are using a different version of PHP, please modify the command accordingly (e.g. php8.2-redis).

 

Next, we'll create a new user account for the Redis server:

 

redis-cli

 

ACL SETUSER vimp resetkeys resetchannels -@all +@read +@write +@scripting
ACL SETUSER vimp on >MySecretPassword123 ~* resetchannels

 

Replace MySecretPassword123 with a secure password.

 

And we exit the Redis console again:

exit

 

Your Redis database is now successfully set up and ready to use.

 

 

Installing Redis on Red Hat Enterprise Linux 9 / AlmaLinux 9

The following steps describe how to install and perform basic configuration of Redis on RHEL 9 and AlmaLinux 9.

 

We assume that the commands are executed as the root user. Otherwise, you must prefix each command with sudo.

 

Install Redis

First, update the package metadata:

 

dnf makecache

 

Next, check which Redis versions are available:

 

dnf module list redis

 

Install Redis 7 using the corresponding AppStream module:

 

dnf module install -y redis:7

 

This command installs Redis along with all required dependencies.

 

Verify the installed Redis version:

 

redis-server --version

 

Enable and start the Redis service

To ensure Redis starts automatically when the system boots, enable and start the service:

 

systemctl enable --now redis

 

Check the service status:

 

systemctl status redis

 

The service should be displayed as active (running).

 

Important: On RHEL and AlmaLinux, the systemd service is named redis, not redis-server as commonly used on Debian and Ubuntu.

 

Configure Redis

The Redis configuration file is located at:

 

/etc/redis/redis.conf

 

Open the configuration file using a text editor:

 

nano /etc/redis/redis.conf

 

If Redis is used exclusively by VIMP on the same server, make sure the following settings are configured:

 

bind 127.0.0.1 -::1
protected-mode yes
port 6379

 

These settings ensure that Redis only accepts connections through the local loopback interface and is not accessible via external network interfaces.

 

After making changes to the configuration, restart Redis:

 

systemctl restart redis

 

Test the Redis connection

Use the following command to verify that Redis is running and accepting connections:

 

redis-cli ping

 

If the connection is successful, Redis responds with:

 

PONG

 

This test assumes that no authentication is required. If authentication has already been configured, the appropriate credentials must be provided.

 

Configure Redis users and access permissions

For use with VIMP, Redis users and their access permissions can now be configured using ACLs (Access Control Lists).

 

The configuration process is essentially the same on RHEL and AlmaLinux as it is on Debian and Ubuntu.

 

redis-cli

 

ACL SETUSER vimp resetkeys resetchannels -@all +@read +@write +@scripting
ACL SETUSER vimp on >MySecretPassword123 ~* resetchannels

 

Replace MySecretPassword123 with a secure password.

 

Then exit the Redis console:

 

exit

 

Note: When Redis users are configured using ACL SETUSER, the settings must be saved permanently. If no separate ACL file is configured, this can be done using CONFIG REWRITE. If a separate ACL file (aclfile) is used, the settings must be saved using ACL SAVE.

 

Your Redis database is now successfully configured and ready for use.


Share via

Related Articles

© VIMP GmbH