Docker is not the problem on a 1 GiB server. The daemon idles under 50 MB. The real problem is that Compose will happily start five containers with no memory limits at all, and when memory runs out the kernel's OOM killer does not ask which one you meant to keep. Sometimes it picks sshd.
Here are six things to set up on a small box before you add a single container.
1. Install Docker Engine from Docker's repo, not docker.io
Ubuntu's own repository ships an old, renamed build called docker.io . Add Docker's official apt repository instead (the steps are in Docker's Ubuntu install guide), then:
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo usermod -aG docker "$USER" newgrp docker
Enter fullscreen mode
Exit fullscreen mode
From here on it is docker compose , a subcommand of the docker CLI with no hyphen, not the old standalone docker-compose binary. The compose file syntax is the same either way.
2.…