Issue
I have server with debian operating system. I installed docker on it and it works fine, as you can see as follow:
root@3053b0461a3c:/# which wget
/usr/bin/wget
root@3053b0461a3c:/#
An ubuntu based container is running.
Then I started a second terminal, connect via ssh to server and type in console
docker ps
But as output I've got the message:
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Why the docker service is not running?
Solution
Unset the environment variable DOCKER_HOST
and it should work.
Try unset DOCKER_HOST
In most unix-based (or -like) environments that I've seen there is the concept of environment variables, which can be considered as dynamic configuration. The 2 functions available are:
set
which sets to an environment variable a special valueunset
which removes an environment variable.
On the case of DOCKER_HOST
, docker uses this variable to know whether it should attach to a network host, e.g. tcp://192.137.23.11
or to a local Unix socket.
Answered By - ipinak