You might receive this error when trying to run any Docker command:
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
The solution to this is to add yourself to the docker group by executing the following commands:
sudo groupadd docker
sudo gpasswd -a${USER} docker
sudo service docker restart
Restart your computer. Credit to Santosh
If you encounter the following error after adding yourself to the docker group:
Failed to start docker.service: Unit docker.service is masked.
You should execute the following commands:
systemctl unmask docker.service systemctl unmask docker.socket systemctl start docker.service
Docker can now be used as expected. Credit to Andy