WSL Ubuntu - permission denied while trying to connect to the Docker daemon socket

When a user runs the docker command, WSL Ubuntu returns a message "permission denied while trying to connect to the Docker daemon socket"

Possible solution:

sudo usermod -aG docker $USER

Exit WSL terminal window then restart WSL terminal window.

docker run hello-world

Docker should be pulling the image from the server and create a container.