Follow the given steps in an order to use docker without sudo.
Initially, add the docker group.
sudo groupadd docker
$USER should be added to the docker group. If you do not want to utilise your current user, change the user name to match your preferred user:
sudo gpasswd -a $USER docker
newgrp docker or log out and log in to make the changes and run :
docker run hello-world
If the above code run successfully then you can use docker without sudo.