Docker can’t connect to Container exposed port

So the problem can be broken down to the following steps:

  1. Check the docker inspect or docker ps results to ensure that you have your port exposed correctly
  2. Try to connect to it using the public IP. If you got an error message for example

    • Connection Refused: The reason could be because the application inside the container is not running as expected. for example you need to ensure that the application bind to 0.0.0.0 and not 127.0.0.1

    • Connection Timeout: The reason could be a firewall outside the server like SecurityGroups in AWS or similar or maybe docker is not managing the server firewall (which is not the default setup)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)