Skip to content

Redis cache and data store service for DDEV

License

Notifications You must be signed in to change notification settings

ddev/ddev-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

add-on registry tests last commit release

DDEV Redis

Note

This add-on has absorbed functionality from ddev/ddev-redis-7, see Advanced Customization.

Overview

Redis is an in-memory key–value database, used as a distributed cache and message broker, with optional durability.

This add-on integrates Redis into your DDEV project with Redis persistence enabled by default.

Installation

ddev add-on get ddev/ddev-redis
ddev restart

After installation, make sure to commit the .ddev directory to version control.

Usage

Command Description
ddev redis-cli Run redis-cli inside the Redis container
ddev redis Alias for ddev redis-cli
ddev redis-flush Flush all cache inside the Redis container
ddev describe View service status and used ports for Redis
ddev logs -s redis Check Redis logs

Redis is available inside Docker containers with redis:6379.

Redis Credentials

By default, no authentication is required.

If you have the optimized config enabled (ddev dotenv set .ddev/.env.redis --redis-optimized=true), the credentials are:

Field Value
Username redis
Password redis

For more information about ACLs, see the Redis documentation.

Advanced Customization

To apply an optimized configuration from ddev/ddev-redis-7:

ddev dotenv set .ddev/.env.redis --redis-optimized=true
ddev add-on get ddev/ddev-redis

# (optional) if you have an existing Redis volume, delete it to avoid problems with Redis:
ddev stop
docker volume rm ddev-$(ddev status -j | docker run -i --rm ddev/ddev-utilities jq -r '.raw.name')_redis

ddev restart

Make sure to commit the .ddev/.env.redis file to version control.

To change the used Docker image:

ddev dotenv set .ddev/.env.redis --redis-docker-image=redis:7
ddev add-on get ddev/ddev-redis

# (optional) if you have an existing Redis volume, delete it to avoid problems with Redis:
ddev stop
docker volume rm ddev-$(ddev status -j | docker run -i --rm ddev/ddev-utilities jq -r '.raw.name')_redis

ddev restart

Make sure to commit the .ddev/.env.redis file to version control.

All customization options (use with caution):

Variable Flag Default
REDIS_DOCKER_IMAGE --redis-docker-image redis:7
REDIS_OPTIMIZED --redis-optimized false (true/false)

Credits

Contributed by @hussainweb based on the original ddev-contrib recipe by @gormus

Optimized config from ddev/ddev-redis-7 contributed by @seebeen

Maintained by the DDEV team