Set up Redis service

Redis is an optional, backend cache solution that replaces the Zend Framework Zend_Cache_Backend_File, which Adobe Commerce uses by default.

See Configure Redis in the Configuration guide.

Use the following instructions for service setup on Pro Integration environments and Starter environments, including the master branch.

NOTE

Submit an Adobe Commerce Support ticket to change the service configuration on Pro Production and Staging environments.

To enable Redis:

  1. Add the required name and type to the .magento/services.yaml file.

    myredis:
        type: redis:<version>
    

    To provide your own Redis configuration, add a core_config key in your .magento/services.yaml file:

    cache:
        type: redis:<version>
    
  2. Configure the relationships in the .magento.app.yaml file.

    runtime:
        extensions:
            - redis
    
    relationships:
        redis: "redis:redis"
    
  3. Add, commit, and push your code changes.

    git add -A && git commit -m "Enable redis service" && git push origin <branch-name>
    
  4. Verify the service relationships.

TIP

After initial service setup, you can change the software version for an installed service by updating the services.yaml and .magento.app.yaml configuration files. See Change service version.

Using the Redis CLI

Assuming your Redis relationship is named redis, you can access it using the redis-cli tool.

  1. Use SSH to connect to the Integration environment with Redis installed and configured.

  2. Open an SSH tunnel to a host.

    redis-cli -h redis.internal
    

Get installed Redis version

Use the following command to get the Redis version installed on an Integration environment:

redis-cli -h redis.internal info | grep version
redis_version:5.0.0
gcc_version:6.3.0

To get the Redis version installed on a Staging or Production environment, use the redis-server command:

redis-server -v
Redis server v=5.0.5 sha=947ee0b5:0 malloc=jemalloc-5.1.0 bits=64 build=c1ca234caf5bd678

Troubleshooting Redis

See the following Adobe Commerce Support articles for help with troubleshooting Redis problems:

On this page