Setting Redis password on Docker using ENV variable

So for most Docker database setups, we simply set an environment variable to create an account user and password.

This doesn't currently work with the official Redis Docker repo (

Instead, Redis uses config flags as documented by this post.

The summary? Use the --requirepass flag. Here is what a sample command might look like:

$ docker run --name my_redis_instance -d redis --slaveof 6379 --requirepass my_secret