Skip to content

Docker Desktop Kubernetes port conflict

Docker Desktop may fail to start its integrated Kubernetes cluster due to a port binding error, specifically listening on 127.0.0.1:6443.^[400-devops__03-Containerization__docker-desktop-k8s-startup-fail.md]

Symptoms

The startup failure logs indicate that the Kubernetes backend cannot expose the external port required for the API server.^[400-devops__03-Containerization__docker-desktop-k8s-startup-fail.md] Specifically, the system reports that it cannot bind to the necessary socket because of an access permission error, despite the error message resembling a standard "port already in use" conflict.^[400-devops__03-Containerization__docker-desktop-k8s-startup-fail.md]

The log output typically contains the following error message:^[400-devops__03-Containerization__docker-desktop-k8s-startup-fail.md] listen tcp 127.0.0.1:6443: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

Resolution

The issue is caused by the Windows NAT (Network Address Translation) service (winnat) holding the necessary ports or conflicting with Docker's networking stack.^[400-devops__03-Containerization__docker-desktop-k8s-startup-fail.md]

To resolve the conflict, stop the Windows NAT service via the command prompt:^[400-devops__03-Containerization__docker-desktop-k8s-startup-fail.md]

net stop winnat

After stopping the service, restart Docker Desktop and retry enabling Kubernetes.

Sources

^[400-devops__03-Containerization__docker-desktop-k8s-startup-fail.md]