I am trying to use Docker CLI without sudoing every command.
For context, I am new to Linux. I've used Linux on a DigitalOcean server for about 30 hours total. This is my first Linux laptop. It is on Ubuntu 22.04.
Anyway, I'm pretty sure the common solutions aren't working because they presume sudo usermod -aG docker $USER will give Docker the same permissions as my logged in user. But I still have to write sudo before commands, so giving Docker the same permissions I have (without writing sudo first) doesn't change anything.
To show my research I've visited the three following pages and a dozen more I won't list that say the same thing
cannot connect to Docker daemon socket without sudo
Allow non-root user to use some Docker commands
How can I use docker without sudo?
https://docs.docker.com/engine/install/linux-postinstall/
The summary of the advice is
sudo groupadd docker
sudo usermod -aG docker $USER
// then one of: "newgrp docker" | "reboot" | log out and back in
docker run hello-world
but when I do docker run hello-world I get
docker: Cannot connect to the Docker daemon at unix:///home/rlm/.docker/desktop/docker.sock. Is the docker daemon running?.
This tells me sudo was still necessary to run docker because sudo before the prev cmd still works.
So what do I have to do to make these steps work for me? Do I have to elevate the account I use for my laptop (Im the only user) to root so that giving Docker my permissions removes need for sudo? I don't want my typical logged in user (even if its me) to be able to run just any command without sudo in front of it. That seems bad to me.