docker.sock connect permission denied

Hey, I am running coder as a docker container. Now I want to add a template but get the Error: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied error.
I saw a post here saying to chmod 666 the docker.sock but I dont like that.

I have tried sudo usermod -aG docker coder to add the coder user to the docker group to make it able to access the docker.sock but it does not work. Any Ideas how I can fix this?
Thanks ^^
Was this page helpful?