docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
TL;DRThis error means the Docker command line tool cannot reach the background Docker service that actually runs containers. The service is either stopped, not installed correctly, or the user lacks permission to talk to it.
Most likely cause: The Docker daemon service is not running on this machine
Try first: Check if the Docker service is active (systemctl status docker)
Likely causes
- The Docker daemon service is not running on this machinemost likely
- The current user does not have permission to access the Docker socketpossible
- Docker was installed but the service failed to start due to a configuration problemless likely
How to fix it
Safest first: SafeChanges settingsDangerous
Check if the Docker service is activeSafe
Run the following command to see the current status of the Docker service.
systemctl status dockerStart the Docker serviceChanges settings
If the service is not running, start it with this command. This changes the running state of the service.
sudo systemctl start dockerEnable Docker to start automaticallyChanges settings
Make sure Docker starts on every boot so the error does not return after a restart.
sudo systemctl enable docker
If that didn't fix it
Docker commands will continue to fail and you will not be able to run or manage any containers.
When to see a technician
Consult a technician if the Docker service fails to start after the commands above or if you see additional error messages about permissions or missing files.
Related errors
codepermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sockcodeERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)codedocker: Error response from daemon: Bind for [IP]:8080 failed: port is already allocatedcodePython was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from SettingscodeError: Cannot find module (node:internal/modules/cjs/loader)codeImportError: cannot import name from partially initialized module (most likely due to a circular import)