Note
This add-on has absorbed functionality from ddev/ddev-redis-7
, see Advanced Customization.
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.
ddev add-on get ddev/ddev-redis
ddev restart
After installation, make sure to commit the .ddev
directory to version control.
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
.
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.
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 ) |
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