Add your user to docker group and try again.
sudo gpasswd -a $USER docker
newgrp docker
If you still have the problem, you may try after logging out and login back, or reboot. Or simply do:
sudo su $USER
Note: this may also happens if docker is not running on your machine. For linux with sytemd service manager, you could verify using command:
systemctl status docker.service