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.
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
codeSyntaxError: Cannot use import statement outside a modulecodeTypeError: Cannot read properties of undefined (reading 'map')codePermission denied (publickey). fatal: Could not read from remote repository.codegit push: error: failed to push some refs (rejected, non-fast-forward)codefatal: refusing to merge unrelated histories