This article lists some experiences from working with Ubuntu on different projects.

Useful Ubuntu tips and tricks Image by @purlzbaum on Unsplash

Resolving error: Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

Due to the fact that an app I was working on had a large number of containers running, and also due to the fact that these Docker containers were starting on boot up, this was significantly slowing my boot times and my machine’s general performance. Since the machine’s RAM was already maxed out, the only thing I could do was use systemctl to prevent the auto-bootup of the said Docker containers. Which worked great, except when I wanted to boot them up manually, I got the error referenced in the above title:

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

The solution was to simply run the following command:

systemctl start docker

Once I did that, my Docker containers obeyed all other commands, which makes perfect sense, because the above command is the one that actually starts the docker daemon.

What does docker ps do?

The docker ps is one of the basic commands in Docker. It checks for running containers. The ps command is short for “Process Status”. This command was borrowed in Docker from Linux operating system with the same meaning: “Process Status”.