Set up Redis service
We support Redis versions 2.8 and 3.0.
Redis 3.0 supports up to 64 different databases per instance of the service, while 2.8 allows for only a single database.
Add Redis in services.yaml and .magento.app.yaml
To enable Redis, add the following code with your installed version and allocated disk space in MB to
If you want to provide your own Redis configuration, you can add a
core_config key in your
To configure the relationships for the environment variable, set a relationship in your
.magento.app.yaml in the Git branch. For example:
Merge and deploy the code to set the configurations for Redis. For information on how these changes affect your environments, see
Verify environment-related relationships
We use the Magento Commerce (Cloud) environment variable
$MAGENTO_CLOUD_RELATIONSHIPS, a JSON object, to retrieve environment-related relationships.
To verify this information used for configurations and settings:
- SSH into the Integration environment with Redis installed and configured.
Enter the following command to pretty-print connection information for Redis:
php -r 'print_r(json_decode(base64_decode($_ENV["MAGENTO_CLOUD_RELATIONSHIPS"])));'
The response includes all relationships for services and configuration data for that environment. In the response, you will locate data similar to the following for Redis:
redis-cli to access your Redis service
Assuming your Redis relationship is named
redis, you can access it by opening an SSH tunnel to a host named
redis.internal using the redis-cli tool.
- SSH into the Integration environment with RabbitMQ installed and configured.
Enter the following command:
redis-cli -h redis.internal