Docker Community Forums

Share and learn in the Docker community.

Problem using localhost ( ports


I’ve been using docker version 20.10.9 in linux.

This week I was trying to run an image that always worked using ports localhost:8500 or localhost:8501 , but suddenly it stopped to work in localhost and just works in the internal container IP like or

If I try to use localhost or again I get connection refused, but the ports are listening normally using the command sudo lsof -i -P -n | grep 8500 or sudo lsof -i -P -n | grep 8501

Docker service status also looks normal.

telnet command for works but for localhost I have my connection refused.

I already tried to restart docker and reload daemon , even tried to reinstall docker , but the problem persists.

I really wanted to use localhost again and really wanted to find a solution without need to reboot, since I am working with remote access in the server of my company .