Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
I write theses commands to give me Sudo permission while I am working with docker in terminal '''
sudo groupadd docker
sudo usermod -aG docker ${USER}
newgrp docker
'''
but after closing the terminal it does not save the configuration for next terminals that I am opening