The Docker client communicates with the server via a socket owned by root. The daemon will set the ownership of the socket to the docker group if the group exists on startup. We’ll have to create this group and add our user to it.
$ sudo groupadd docker
# -aG will append the group to your supplementary groups.
$ sudo usermod -aG docker your_username
You will need to log out and in again for the change to take effect.