docker redis localhost connection code example Example: run docker redis localhost docker run --name my-redis -p 6379:6379 -d redis:alpine