Docker Error: error invoking remote method ‘docker-start-container‘: error: (http code 500) server error –

Docker container cannot be started. An error is reported after startup:

error invoking remote method 'docker-start-container': error: (http code 500) server error - ports are not available: listen tcp 0.0.0.0:3306: bind: an attempt was made to access a socket in a way forbidden by its access permissions.

First restart the computer (host), and then execute it on the command line (or wsl2)

docker ps -a

Check the container ID that cannot be started, and then execute

docker restart Container ID

If it still cannot be started, try to allow the windows (Linux) firewall to pass through the port and make sure it is not blocked by the firewall

Read More: