Docker Not Showing Containers or Starting New Ones
The Symptoms, Because They Are Weird
The site is up. The containers are obviously running, because nginx is answering requests and the app is serving pages. But on the host, docker ps returns an empty table, docker ps -a shows nothing, and docker run fails or hangs.
That combination is the tell. If Docker had really crashed, the containers would be gone with it. An empty list while the workload is still serving means you are talking to a different Docker daemon than the one running your containers.
In my case the cause was boring and avoidable: there were two installations of Docker on the same machine.

Check For Two Installations
Ubuntu makes this easy to do by accident. The official instructions add Docker's apt repository, but a snap install docker at some point (or a tutorial that used the snap) leaves a second, independent daemon with its own socket and its own storage.
snap list | grep docker
dpkg --list | grep docker
If both return results, you have two. They do not share containers, images or configuration. Whichever client binary resolves first on $PATH determines which daemon you are talking to, which is why docker ps can be empty while your site is happily running on the other one.
The Fix
Decide which one you want. In almost all cases it is the apt package, because that is what gets the upstream updates and what every piece of documentation assumes.
sudo snap remove docker
sudo systemctl restart docker.service docker.socket
Then confirm you are talking to the right daemon:
docker context ls
docker info | grep -i 'server version'
docker ps
docker context ls should show default with a socket path under /var/run/docker.sock. If it shows something with a snap.docker path, your context is still pointing at the removed installation — switch back with docker context use default.

The General Diagnostic Order
Two Docker installations is the specific cause I hit, but the same symptom has other parents. Work down this list before reinstalling anything.
Is the daemon actually running?
systemctl status docker
journalctl -u docker -n 50 --no-pager
An empty docker ps with a healthy daemon and running containers almost always means two daemons. journalctl will show you if the daemon restarted and lost the container references.
Are you in the docker group? A permissions error is usually explicit, but inside scripts it can be swallowed:
groups | grep docker
If you are not in the group, every command needs sudo and any script that does not use it fails quietly.
Is DOCKER_HOST set to something unexpected?
echo $DOCKER_HOST
env | grep -i docker
A stale DOCKER_HOST in your shell profile, or in a systemd unit, points the client at a socket that is not the one you think. This is especially common after switching between Docker Desktop and a native install.
Has the daemon run out of disk? Docker stops being able to start containers and can behave erratically when /var/lib/docker is full:
df -h /var/lib/docker
docker system df
Is containerd healthy? If systemctl status docker looks fine but nothing can start, check the layer underneath:
systemctl status containerd
sudo journalctl -u containerd -n 50 --no-pager
If the Containers Are Genuinely Gone
Everything above assumes your workload is still serving and only the client is confused. If the site is actually down, stop and check the obvious things before touching Docker's configuration.
systemctl status docker
docker ps -a
docker events --since 10m
If docker ps -a lists containers in an Exited state, the daemon is fine and they stopped for a reason — read their logs (docker logs --tail 100 <name>) before restarting anything. A container that exited on its own will usually exit again.
If docker ps -a is empty and the site is down, you are closer to a data problem than a connectivity one: the daemon may be pointing at an empty /var/lib/docker because a mount did not come up, or because you are on the other installation. docker info | grep -i 'docker root dir' tells you which directory the daemon you are talking to is actually using, and comparing that against where your containers were stored is the fastest way to tell which of those two it is.

Preventing It Next Time
One installation, installed from one source, and let the package manager own it. If you add Docker's apt repository, remove any snap install first — and check docker context ls after any major upgrade, because that is when a second install tends to appear.
The uncomfortable part of this bug is that it looks like Docker is broken when Docker is fine. Your containers are running; your client is just looking at the wrong place. Which is a good habit to carry into any "nothing is showing up" problem: verify what the tool is actually connected to before you start repairing the thing it is supposedly connected to.
Don't trust the download button. Trust the hash.
If this was useful, More hands-on tech guides at TechGeek. No pressure — read it whenever it's useful.