Connecting Redis from my network in docker .net Core application

You need to place both containers in the same network and connect to Redis using its container name. If you’re using docker run commands, you need to create your own network. With Docker Compose, the network is created for you.

If you paste your docker run commands or your docker-compose.yml file we’ll be able to show you how to make that happen.

If the containers already share a network that’s not the default network, you can simply change the connection string in your .net application. If your container is named redis , replace localhost:6379 with redis:6379.